Development

Tips and Tricks to Master Development

Spring Boot + Hazelcast Tutorial

Development Jun 12, 2018

Learn how to manage High Availability, Leader Election and Horizontal Scaling a Spring Boot application using Hazelcast. Full source code available on Github.


It all started when we had the following problem: How can you enable High Availability in a Rest API based on Spring Boot? As you may know, we have two products: (both based on Spring Boot) OctoPerf Saas-Edition: the online saas platform, OctoPerf Enterprise-Edition: the full on-premise installable version. While Saas-Edition absolutely needs High Availability, the Enterprise-Edition doesn’t share the same requirements. But, as astonishing as it may seem, both versions share exactly the same code, while working slightly differently.

D3.js Tutorial: Drag and Drop

D3.js Tutorial: Drag and Drop

Development Apr 18, 2018

Learn how to handle drag and drop using D3-drag to manipulate SVG graphics. d3.drag() explained via code samples and live examples.


In our previous tutorial we explained how to handle click events with D3.js to add, remove and select shapes in a SVG chart. Using the same map example this tutorial explains how to handle drag and drop with D3.js. To follow this guide you must know about: D3.js installation, D3.js selectors, and D3.js data binding. All these concepts are explained in our D3 getting started guide.

D3.js Tutorial: Mouse Events Handling

D3.js Tutorial: Mouse Events Handling

Development Apr 17, 2018

Learn how to handle mouse events using D3.js to manipulate SVG graphics. d3.datum() and d3.mouse() explained via code and live examples.


This tutorial explains how to handle mouse events using D3.js along with other useful notions: SVG shapes definitions and use, D3 animations and transitions, D3 event propagation, Single element data binding using datum. It consists in a series of explained code samples and live examples. If you are not familiar with D3.js or simply need a reminder, please read our D3.js getting started tutorial. A Simple SVG Map For this tutorial we will use a simple map:

D3.js getting started: a first tutorial

D3.js getting started: a first tutorial

Development Apr 12, 2018

Learn how to use D3.js to manipulate DOM elements to match evolving data. An animated guide to the enter/update/exit concept.


D3.js (Data-Driver Documents) is an Open-Source JavaScript library for manipulating DOM elements based on data. D3 makes use of the standards SVG, HTML5, and CSS. It is good at creating charts, maps, or any other visual representations of data. D3.js allows great control over the final visual result, at the cost of a steep learning curve. Some concepts must be understood before using this powerful library. That is the exact purpose of this blog post: help you to get started with D3 code samples and animated graphics.

Java - 10+ Amazing Ways to Write to File

Java - 10+ Amazing Ways to Write to File

Development Mar 21, 2018

Let’s crush simple code examples to show you how to use BufferedWriter, PrintWriter, InputStream and OutputStream, FileChannel, Apache Commons IO and more.


It’s surprising to see how many different ways exist to write a File in Java! It can be quite confusing… This is why we made this tutorial. We’ll explore the different ways, the best practices involved as well as the common pitfalls. If you’re wondering how to write text or binary data in a File, you’re in the right place! Input Streams Yet another way to write data into a File in Java is using streams.

Java Arrays

Java Arrays

Development Mar 20, 2018

An Array is a primitive data structure which stores a fixed number of elements. Learn how to create, iterate, clone arrays and more.


You’re probably not the first one to wonder how arrays work in Java. And you haven’t found a clear answer yet! I have some good news… This post is all about understand how arrays work, how to create them, how to store data and much more. I promise, you won’t be disappointed! Let’s dive into the world of those mysterious arrays! What is an Array Java Arrays are part of primitive types.

Java ArrayList

Java ArrayList

Development Mar 19, 2018

Java’s ArrayList is a dynamic array implementation of the List interface. Learn how and when an ArrayList should be used.


I guess you’re here because you want to learn how to use the ArrayList in your Java code. You’re in the right place! As explained in the Java documentation, ArrayList is: A resizable array: implementing the List interface, Mutable: objects can be added and/or removed, Not Thread-safe: ArrayList is not suitable for concurrent access. See Thread Safety for more information. Let’s explore how to use an ArrayList through simple code examples!

Java LinkedList

Java LinkedList

Development Mar 19, 2018

Java’s LinkedList is a doubly-linked List implementation. Lists are ordered sequences of objects. Learn how and when a LinkedList should be used.


The question which often arises is: are LinkedList preferable to ArrayList? In which case should I use it? As explained in the Java documentation, LinkedList is: A doubly-linked chain: elements are stored in nodes, with linking back and forth between themselves, Mutable: objects can be added and/or removed, Not Thread-safe: LinkedList is not suitable for concurrent access. See Thread Safety for more information. Let’s explore how to use a LinkedList through simple code examples!

Java Math.pow Through Code Examples

Java Math.pow Through Code Examples

Development Mar 16, 2018

Math pow is a function which calculates the power of any base number in Java. We’re going to learn how to avoid the common pitfalls around this method.


I’m sure you have already experienced odd results when calling Math.pow method. I know, I’ve been there too! Math.pow(double a, double b) returns the value of a raised to the power of b. It’s a static method on Math class, which means you don’t have to instantiate a Math instance to call it. The power of a number is the number of times the number is multiplied by itself.

Securing a Rest API with Spring Security

Securing a Rest API with Spring Security

Development Mar 8, 2018

Quick and easy way to secure a Rest API with Spring Security. Spring Boot 2 and Spring Security 5 tutorial with real-world code examples.


Most Spring Tutorials available online teach you how to secure a Rest API with Spring with examples which are far from real application problematics. You surely agree that most tutorials lack real-world use-cases. This tutorial aims to help you secure a real-world application, not just another Hello World Example. In this tutorial we’ll learn: How to secure a Spring MVC Rest API using Spring Security, Configure Spring Security with Java code (no painful XML), And delegate authentication to a UserAuthenticationService with your own business logic.