Excel Pivot Table using Apache POI

Create an Excel Pivot table from Java using Apache POI.

“A foolish faith in authority is the worst enemy of truth.”
― Albert Einstein

1. Introduction

A Pivot Table is a tool used in Excel for summarizing data. It helps group data using user-selected criteria and compute group summaries using functions such as total, average, count, etc.

Continue reading “Excel Pivot Table using Apache POI”

Hadoop Tutorial

Learn how to get started with Hadoop (2.7.3). Demonstrates single process and single node distributed execution.

“We are all different. Don’t judge, understand instead.”
― Roy T. Bennett, The Light in the Heart

1. Introduction

Hadoop is a toolkit for big-data processing. It uses a cluster of computers to split data into multiple chunks and process each chunk on one machine and re-assemble the output.

Continue reading “Hadoop Tutorial”

Introductory Spring Boot Rest Service

A very basic Spring MVC Web Application. Illustrates the outline of a Spring project.

“The only true wisdom is in knowing you know nothing.”
― Socrates

1. Introduction

Getting started with Spring and Spring Boot? Welcome!

This is a beginner level tutorial for implementing a Hello World REST Service using Spring Boot. The emphasis is on getting the basic application outline worked out. One to which we can add various enterprise features in further articles.

The example presented is simple REST controller which returns a message to the user.

Continue reading “Introductory Spring Boot Rest Service”

Java Streams groupingBy Examples

Learn how to perform SQL-like grouping and summarizing calculations on Java Collections (List, Map, etc).

1. Introduction

Have you wanted to perform SQL-like operations on data in a List or a Map? Maybe computing a sum or average? Or perhaps performing an aggregate operation such as summing a group? Well, with Java 8 streams operations, you are covered for some of these.

A previous article covered sums and averages on the whole data set. In this article, we show how to use Collectors.groupingBy() to perform SQL-like grouping on tabular data.

Continue reading “Java Streams groupingBy Examples”

Using Java Collectors

Use Java 8 Streams and Collectors to slice and dice lists including computing sums, averages, partitioning and more.

1. Introduction

Java 8 provides the new Streams facility which makes many Collection operations easy. Streaming items from a collector and filtering the data are trivial. As well as are sorting, searching and computing aggregates. That is, if you are familiar with the many Collectors functions available. We present some of these functions here.

Continue reading “Using Java Collectors”

Convert Excel to CSV (UTF-8)

Export data from Excel spreadsheet to CSV using Java. Properly handles exporting Unicode data in the spreadsheet.

1. Introduction

Let us look into how to convert Excel to CSV.

CSV stands for Comma-Separated-Values and is a very common format used for exchanging data between diverse applications. While the Excel Spreadsheet file format is complex (since it has to accommodate a lot more!), CSV is a simpler format representing just tabular data.

Continue reading “Convert Excel to CSV (UTF-8)”

Excel Color Coding Cells

Conditional Formatting in Excel is very useful to highlight cells based on cell value. In this easy tutorial, learn the basics of how to do so.

1. Introduction

Color coding of cells based on a condition is very useful in Excel for highlighting areas and data points. It is one of the top tools in the arsenal of an Excel expert in making the spreadsheet look snazzy and convey crucial information. In this article, we show a simple example of how to apply conditional formatting to cells based on values.

Continue reading “Excel Color Coding Cells”

Java Process Example Part 2

When reading and writing to a child process, it is necessary to execute the read and write blocks in separate threads to avoid deadlock.

1. Introduction

In the previous part of this Java Process Guide, we looked at how to read from and write to a child process. While executing the read and write blocks in a single thread works for simple cases, we should run these in separate threads to avoid deadlocks.

Continue reading “Java Process Example Part 2”

Java Process Example

Startup a native process from Java using Runtime. Read the output from the process and write some data to it. After you are done, terminate the process.

1. Introduction

Have you ever run into a situation where you need to execute an OS command from inside java and read its output? You can use the Process class to do so, but there are some caveats to consider.

Continue reading “Java Process Example”