Recent Posts

JUnit 5 Annotations Example

In this article, we will walk through some JUnit 5 annotations that often be used when we write tests. 1. Preparation This section introduces some preparations you may need to set up if you want to get started with JUnit 5. JUnit 5 requires Java 8. You can set up environment for JUnit 5 with […]

0 comments

Install Spring Boot Command Line Interface on Linux

This article will show you how to install Spring Boot Command Line Interface on Linux system, which includes RHEL, CentOS, Fedora, Debian, Ubuntu, etc. There are 2 ways for us to do that. The first is to install manually and the second is to install with SDKMAN. We will cover both of 2 ways in […]

0 comments

Install Spring Boot Command Line Interface on Windows

Spring Boot is gaining much attention today. There are several ways to get started with Spring Boot. One of them is to use Spring Boot Command Line Interface (CLI). In this article, I’d like to show you how to install Spring Boot command line interface on Windows. 1. Prerequisites Spring Boot CLI requires Java 6 […]

1 comment

Java 8 Traverse List, Set

To continue the series about Java 8 new features, I’d like to mention about traversing through collections like List, Set, Map using new Java 8 traverse API. Assume that we have a collection of days as following and we want to traverse or iterate though the collection.

1. Using an Iterator 1.1. Traditional way […]

0 comments

JUnit 5 Dynamic Tests – Generate Tests at Run-time

To continue the series about JUnit 5 tutorial, I’d like to introduce about JUnit 5 Dynamic Tests feature which allows us to declare and run test cases generated at run-time. 1. Static Tests vs Dynamic Tests 1.1. Static Tests To get to know about the Dynamic Tests vs Static Tests, let take a look at […]

0 comments

JUnit 5 Nested Tests Examples

In this tutorial, we will get to know about JUnit 5 Nested Tests, how to use the JUnit 5 @Nested annotation to express the relationship among several group of tests. Let’s say we need to write tests for a class that has some functions and several of them have complex business domain logic. Normally, we […]

2 comments

JUnit 5 Assumptions With Assume

To continue the series about JUnit 5 tutorial, we will get to know about JUnit 5 Assumptions. During the development, there is some situations that the source code is not written well, dependent on some conditions temporarily  and this might cause several tests to fail. For example, a Backup file function should work on any […]

1 comment

JUnit 5 Test Suite – Aggregating Tests In Suites

To continue the series about JUnit 5 tutorials, in this post, we will try to get to know about JUnit 5 test suite which is a concept of aggregating multiple test classes in a test suite so that we can run those together. 1. Preparation You will need to get JUnit 5 be ready in […]

0 comments

JUnit 5 Exception Testing

To continue the JUnit 5 tutorial series, I’d like to share about JUnit 5 exception testing, how JUnit 5 supports us in testing exception. 1. Preparation The basic source code can be found in Github. You will need to get JUnit 5 be ready in your environment. You can do it by yourselves or refer […]

0 comments

JUnit 5 Disable or Ignore A Test

To continue the series of the JUnit 5 tutorials, I’d like to share how to disable or ignore a test in JUnit 5. During the development, you may want to temporarily ignore or disable a test, a group of tests or even disable a test class for some reasons. There are several ways for you […]

2 comments

JUnit 5 Assertions Example

JUnit Jupiter, a module of JUnit 5 which is a next generation of JUnit 4, comes with many of assertion methods that JUnit 4 has and adds some overloads which can be used with Java 8 Lambda Expression. In this post, we will try some examples that use both JUnit 5 assertions lent from JUnit […]

2 comments

JUnit 5 vs JUnit 4

JUnit 5, which is the next generation of JUnit, promises to be a programmer-friendly testing framework for Java 8. In this post, JUnit 5 vs JUnit 4, let’s discover some major differences between them. 1. Components JUnit 4. All in one. JUnit 5. There are 3 separated modules: JUnit 5 = JUnit Platform + JUnit […]

3 comments

JUnit 5 Basic Introduction – Getting Started With The Next Generation of JUnit

Unit test is very essential in ensuring the quality of source code developed by developers.  In the Java world, JUnit is a very simple framework that supports developers to implement Unit test of their source code.  The current stable version of JUnit is 4.12. However, with the goal is to support new features in Java […]

7 comments

Apache Flume Kafka Source And HDFS Sink Tutorial

To continue the series about Apache Flume tutorials, I’d like to share an example about Apache Flume Kafka Source and HDFS Sink. One of popular use case today is to collect the data from various sources, send them to Apache Kafka which will make them be ready for real-time processing and analysis with other frameworks […]

2 comments

Apache Flume HDFS Sink Tutorial

Apache Flume is a distributed tool to collect and move a large amount of data from different sources to a centralized data store. Apache Flume introduces 2 basic concepts I’d like to introduce in this tutorial. The first one is the Flume Source, which consumes the data from external data sources. Apache Flume currently supports […]

1 comment

Apache Kafka Connect MQTT Source Tutorial

To continue the topic about Apache Kafka Connect, I’d like to share how to use Apache Kafka connect MQTT Source to move data from MQTT broker into Apache Kafka. Note that from the version 0.9, Apache Kafka introduce a new feature called Kafka Connector which allow users easily to integrate Kafka with other data sources. […]

4 comments

Java REST Client Using Unirest Java API

Unirest is lightweight HTTP request client libraries available in multiple languages including Java, .NET, Ruby, Node, Objective-C, etc. Like other REST client libraries, Unirest aims to  simplify making HTTP REST requests. In this tutorial, I’d like to share how to implement Java REST client using Unirest Java API. 1. Preparation Assume that we have a […]

0 comments

Vagrant Docker Provider Tutorial

Vagrant, a great tool for managing lifecycle of virtual machines, is not the same with Docker, another great tool for building and  running software container. In this tutorial, I’d like to introduce about Vagrant Docker Provider which allow our development environment to be backed by Docker container rather than virtual machines. 1. Introduction to Vagrant […]

0 comments

Install Vagrant on Ubuntu 16.04 LTS (Xenial Xerus)

In this post, I’d like to show how to install Vagrant on Ubuntu 16.04. We may have 2 approaches to install Vagrant on Ubuntu. Use apt-get to install Vagrant from the repository of the distribution Download proper binary package from the Vagrant download page and install it normally. We will try both of them. 1. […]

1 comment

Using Apache Kafka Docker

Continue the tutorial series about Apache Kafka, today, I’d like to share how to get Apache Kafka installed by using Apache Kafka Docker. 1. Preparation You first should have latest versions of Docker installed on your machine. If not, you can use virtual machine with VirtualBox or VMware player, and you can try with Vagrant which […]

1 comment

Java REST Client Using Netflix Feign

Continue the series about Java REST client, I’d like to share how to implement Java REST client using Netflix Feign. As mentioned in the Feign site, Feign is a java to http client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. In similar to other REST client frameworks, libraries, Feign aims to simplify the interaction between […]

3 comments

Install Docker on CentOS 7.X

This post is for those who want to install Docker on CentOS 7.X. I just wanted to summarize all basic steps so that Docker installation on CentOS 7.X is actually quite simple. 1. Preparation 1.1 Check Kernel Version – Your CentOS 7.X must be 64-bits OS – Kernel version should be 3.10 at minimum You […]

1 comment

Java REST Client Using Apache CXF Proxy based API

Continue the series about Java REST client, I’d like to share how to create Java REST client using Apache CXF Proxy based API. In similar to the JBoss Resteasy Client Framework, there are several ways to implement REST client with Apache CFX client. The first one is to leverage the JAX-RS 2.0 Client API, the second […]

1 comment

Java REST Client Using Resteasy Client Proxy Framework

Continue the series about Java REST client, I’d like to share how to create Java REST client using Resteasy Client Proxy Framework which is provided by JBoss. As mentioned in my previous post: Java REST Client Using Resteasy Client, Resteasy Client Proxy Framework is another approach to create Java REST client beside the traditional way, […]

3 comments

Java REST Client Using Resteasy Client

Continue series about Java REST client, I’d like to share how to create Java REST client using Resteasy Client API which is a Restful web service provided by JBoss. Generally speaking, there are 2 approaches to create Java REST client with Resteasy Leverage the JAX-RS 2.0 Client API implemented by JBoss Use the Resteasy Proxy […]

2 comments

Basic Vagrant Commands

Below are some basic Vagrant commands that often be used when we work with Vagrant. 1. Check current version

or

The output should be similar to below:

These commands also can be to check whether Vagrant is ready to work on our environment or not. 2. List all boxes We may need […]

1 comment

Apache Kafka Connect Example

1. Introduction to Apache Kafka Connect Apache Kafka, which is a kind of Publish/Subscribe Messaging system, gains a lot of attraction today. We can see many use cases where Apache Kafka stands with Apache Spark, Apache Storm in Big Data architecture which need real-time processing, analytic capabilities. To integrate with other applications, systems, we need […]

4 comments

Apache Kafka Command Line Interface

Here are some  commands often be used when we work with Apache Kafka command line interface. 1. Start the Kafka server We needs 2 steps 1.1 Start the ZooKeeper

1.2. Start the Kafka server

2. List all topics

The output in my console:

3. Create a topic

The output is: […]

5 comments

Add Local Box To Vagrant

Normally to add a box likes ubuntu/trusty64-juju, you simply need to issue several commands:

Vagrant will automatically download the box and start the virtual machine. However, what if you have a special customized box from your colleague, or you want to download the box by a download manager tool and import it manually. In […]

0 comments

Java REST Client Using Jersey Client

Continue series about Java RESTful client, I’d like to share how to create Java REST client using Jersey client API 1. Preparation Assume that we have an RESTful web services with several API as below: 1.1 Get all books

Responses: application/json 1.2 Create a new book

Request Example:

Responses: application/json Example:

[…]

4 comments

Java REST Client Using Apache Httpcomponents

Continue series about Java REST client, I’d like to share how to create Java REST client using Apache Httpcomponents. 1. Preparation Assume that we have an RESTful web services with several API as below: 1.1 Get all books

Responses: application/json 1.2 Create a new book

Request Example:

Responses: application/json Example:

STATUS […]

9 comments

Java REST Client Using Spring RestTemplate

There are many ways to create Java REST clients such as: using the built-in package: java.net.URL, leveraging client API of RESTful frameworks like Jersey, Resteasy, Spring Rest, etc. In this post, I’d like to show how to create Java REST client using Spring RestTemplate. 1. Preparation Assume that we have an RESTful web services with […]

5 comments

Simple Java REST Client Using java.net.URL package

RESTful web service is very popular today. With supporting from a lot of frameworks such as: Spring Data Rest, Jersey,  JBoss Resteasy, developing a RESTful web service is pretty easy for Java developer. Consuming a RESTful service from client side technologies like Javascript, JQuery is pretty easy too; however, there are some cases which we […]

6 comments

Convert Java Object To JSON and Vice Versa

JSON (JavaScript Object Notation) is very popular today. JSON is used for many purposes: data format in RESTful web service, configuration file format..In the Java world, there are many libraries used for converting objects to JSON and vice versa such as: Jackson, Google Json, Json Lib,..In this post, I’d like to show some basic examples […]

2 comments

Install Node.js, Bower, and Grunt on Windows

Below is how to install NodeJS, Bower, and Grunt on Windows, especially when you’re behind a company proxy with self-signed certificate. 1. Install Node.js Download a proper version Node.js at https://nodejs.org/en/download/ If your OS is 32-bit then download the 32-bit version or download the 64-bit if your OS is 64-bit. After downloading, click on the […]

0 comments

Some Open Source JavaScript Loggers

1. Introduction Below are some open source Javascript loggers that can be used for logging at client side. Today, Single Page Application (SPA) is being adopted and used for a lot of web applications. SPA has a many advantages such as: separating the UI and data, reducing the loading time, fast,  very good for responsive […]

0 comments

Install Build-Essentials for CentOS, RHEL and Ubuntu

Build-essentials is a reference for all packages which are considered essential for building Debian packages. So, if we want to be able to build Debian package,we need to install the build-essential package. To install the package, we just need to execute below command:

Note that you can issue the same command to install the […]

0 comments

How To Write A Custom Serializer in Apache Kafka

To continue the series about Apache Kafka, I’d like to share how to write a custom serializer in  Apache Kafka. 1. Why we need a custom serializer in Apache Kafka? Apache Kafka allows us to send the messages with different data types to the broker. The messages can be string, number, array,…and any type of […]

1 comment

Write An Apache Kafka Custom Partitioner

Continue the series about Apache Kafka, in this post, I’d like to share some knowledge about Apache Kafka topic partition and how to write an Apache Kafka Custom Partitioner. 1. Basic about Apache Kafka Topic Partition. There are many reasons why Apache Kafka is being adopted and used more widely today. Two of them which […]

4 comments

Create Multi-threaded Apache Kafka Consumer

In previous posts, I introduced about how to get started with Apache Kafka by installing and using Java client API 0.9 as well. In this post, I’d like to share how to create multi-threaded Apache Kafka consumer. You can take a look at previous related posts by access below links. Getting started with Apache Kafka […]

1 comment

Introduction to Docker Compose

1. Overview of Docker and related tools In recent years, Docker, which is a virtualization software, gains a lot of attractions, popularizes from software development community. Docker introduces a way to “package an application with all its dependencies into a standardized unit for software development” that we can call container. This container, when is delivered to any environment, […]

0 comments

Apache Kafka 0.9 Java Client API Example

In this article, I’d like to show you how to create a producer and consumer using Apache Kafka 0.9 Java client API. 1. Concept. Apache Kafka has some built-in client tools to produce and consume messages against Apache Kafka broker. However, in term of messaging, both of them are mainly used for simple operations at […]

1 comment

Getting started with Apache Kafka 0.9

In this article, I’d like share some basic information about Apache Kafka, how to install and use basic client tools ship with Kafka to create topic, to produce/to consume the messages. The version used is Apache Kafka 0.9 1. Concept Apache Kafka is a Publish-Subscribe messaging system, originated at Linkedin in 2009, open sourced in […]

4 comments

Install Docker on Ubuntu 14.04/15.10/16.04 Step By Step

This post is for those who wants to install Docker on Ubuntu 14.04/15.10/16.04. I just wanted to summarize all basic steps so that Docker installation on Ubuntu is actually quite simple. 1. Preparation 1.1 Check Kernel Version – Your Ubuntu must be 64-bits OS – Docker requires kernel version should be 3.10 at minimum You […]

0 comments

Install PostgreSQL On Ubuntu

As you may know, PostgreSQL is included in all versions of Ubuntu by default. However, depends on our purposes, we can choose to install it at the time we install Ubuntu or install it separately later. In this post I’d like to share how to install  PostgreSQL on Ubuntu, any version on some LTS versions of […]

0 comments

Install VirtualBox On CentOS 7

In previous post, I shared how to install VirtualBox on Windows 10. To continue the tutorial series about VirtualBox, I ‘d like to share how to install VirtualBox on CentOS 7. You will need to be root or can be executed by root right (Using sudo) 1. Setup VirtualBox Repository

Execute below command to change […]

2 comments

Install VirtualBox on Windows 10

As you may know,VirtualBox is  a cross-platform virtualization application which allows us to create virtual machines on our a computer. VirtualBox can run on almost operating systems like Windows, Linux, Mac,..And we can install any guest operating system on it. So, if you have a Windows PC, and want to do some experiments on Linux, you […]

1 comment
Install Hive on Ubuntu

Some notes when install Hive on Ubuntu

Install Hive on Ubuntu is pretty easy. I have installed Hive: 1.2.1 on Ubuntu: 14.04). And I’d like to take some notes here. First things to remember if get issue when starting Hive are:  Make sure to turn the log level in the $HIVE_HOME/conf/hive-log4j.properties into DEBUG.  Find the log location which was configured in the […]

0 comments

Insecure docker registry

Docker deamon options are parameters/options configured for docker deamon. INSECURE_REGISTRY, which is a parameter used to let docker deamon knows a registry is an insecure docker registry, is one of those options. Those options are described more at the docker site: https://docs.docker.com/articles/systemd/ There are a lot of options we can configure for docker deamon such […]

0 comments

Basic Docker commands

To continue the series of articles about Docker, I’d like to share about some basic Docker commands that we often used when we work with Docker. 0. Very first Docker commands The very first Docker command should be itself which shows how to to use the Docker commands, how many options, parameters, some basic Docker commands… […]

2 comments

Ajax post Json data to Restfull web service

Let’s say we have a Rest service with following info: Path: /user/add Argument is an object of the User class which is described: User{ firstname, lastname, address } create a user javascript object var user = { firstName: “Tom”, lastName: “Riddle”, address: “hw” }; //Then user JSON.stringify to converts a JavaScript value to a JSON […]

0 comments

Postgresql accepts remote connections

By default, PostgreSQL just allows local connections only. To make PostgreSQL accepts remote connections, we have to do some additional steps as below: 1. Basic Steps. Step 1. Edit the pg_hba.conf, put 1 more line.

Step 2. Edit postgresql.conf Find the key listen_addresses=’localhost’ and change it to:

Step 3. Restart Postgresql or reload […]

1 comment

R – Subsetting Data Tips

 

Put a negative integers inside brackets to remove these indices from the data. For ex: Drop the 2nd element

For ex: Drop first 3 elements

 

0 comments

R Data Frame and basic functions

In this article, I’d like to introduce some basic information about the data frame in R and some its basic operations as well. Hope this will bring you some references when working with it in R. 1. Introduction about R data frame In R, data frame is one of the most basic data structure. Generally […]

0 comments

PostgreSQL Authentication

As you may know, PostgreSQL is one of powerful open source Relational  Database Management System (RDBMS) on over the world. PostgreSQL can be run on almost operating systems: Windows, Linux, Mac… Getting PostgreSQL installed in run up are pretty simple. In this post, I’d like to share some knowledge, experience about PostgreSQL authentication methods which […]

0 comments

VirtualBox – Share folder from host

When we work with virtual machines created by virtualization software like VirtualBox, VMWare Workstation,.. we often need a shared folder between host machine and guest machine in order to share software, documents… In this article, I’d like to share  how to share files and folders (directories) between host and guest I have done on my PCs. The […]

0 comments

Change screen resolution of Ubuntu on Virtualbox

After installing Ubuntu 14.04 guest on VirtualBox running on a Window 8 host, I am getting issue with 640×480 screen resolution. . The ‘Detect Displays’ button on the ‘Display Settings’ Settings screen does not work. The resolution 640×480 is too small. Open terminal and type this command:

  Then restart the virtual pc. One more […]

0 comments

Install VirtualBox on windows 8.1

For other version of windows prior to window 8, we may get VirtualBox installed without any problem. But with windows 8( mine is 8.1 pro), after getting VirtualBox installed, the options for creating 64-bit machine don’t appear. All is 32-bit. After googling, I found that we also need to turn off the “hypervisorlaunchtype ” off as following: 1. […]

0 comments

Encode Request Parameters, Query String With Special Characters

There are some cases we need to pass information via URL in form of query string, parameters…In those cases, we need to make sure the query string or parameters should be consisted of allowed characters such as: – Letters (A–Z and a–z) – Numbers (0–9) – Characters ‘.’,’-‘,’~’ and ‘_’ Any other characters should be encoded so that […]

0 comments

C# Enum Methods

As you may know,  enum(enumeration) is very efficient in defining a set of named integral constants that may be assigned to a variable. For basic knowledge about enum, you can take reference at:https://msdn.microsoft.com/en-us/library/sbbt4032.aspx . In this article, I’d like to re-cap some basic examples and some useful C# enum methods in C#  as well. Hopefully provide you a quick reference when […]

0 comments

Some very useful JQuery methods for your quick references

I believe that searching for all very useful JQuery methods in a single article like this is more quickly, productive than google :). Therefore, I summarize some as below. Actually, I got them from StackOverFlow Radio Button 1. Get the value of a selected radio button using its name: $(“input:radio[name=RadioButtonName]”).click(function() { var value = $(this).val(); }); […]

0 comments

Create a clickable label checkbox in ASP.NET MVC

Clickable label checkbox  or Checkbox with clickable label is created easily in HTML but actually need a little tricky in ASP.NET MVC. First of all, we need to see how to create a checkbox with clickable label in HTML. Method 1: Wrap Label Tag

Method 2: Use the for Attribute Use the for attribute (match the […]

0 comments