Guide to Java 8 Collectors: reducing()
Improve your dev skills!
Get tutorials, guides, and dev jobs in your inbox.
Guide to Functional Interfaces and Lambda Expressions in Java
Java is an object-oriented language, imperative in its essence (contrasting with the declarative practice that is functional programming). Nonetheless, it was possible to apply functional principles to Java programs prior to version 8, however it required additional work to bypass the innate structure of the language and resulted in convoluted...
Java 8 Streams: Definitive Guide to partitioningBy()
A stream represents a sequence of elements and supports different kinds of operations that lead to the desired result. The source of a stream is usually a Collection or an Array, from which data is streamed from. Streams differ from collections in several ways; most notably in that the streams...
Java 8 Streams: Definitive Guide to flatMap()
Mapping elements from one collection to another, applying a transformative function between them is a fairly common and very powerful operation. Java's functional API supports both map() and flatMap(). If you'd like to read more about map(), read our Java 8 - Stream.map() Examples! The flatMap() operation is similar...
Graphs in Python: Breadth-First Search (BFS) Algorithm
Graphs are one of the most useful data structures. They can be used to model practically everything - object relations and networks being the most common ones. An image can be represented as a grid-like graph of pixels, and sentences can be represented as graphs of words. Graphs are used...
undefined and null values sneak their way into code flow all the time. Whether we lose a reference through side-effects, forget to assign a reference variable to an object in memory, or we get an empty response from another resource, database or API - we have to deal with undefined...
Java 8 Streams: Definitive Guide to Parallel Streaming with parallel()
Today, the Java Streams API is in extensive use, making Java more functional than ever. Thus, models like MapReduce have emerged for easier stream handling. Although these models made using streams effortless, they've also introduced efficiency concerns. The built-in parallel() operation is simple enough to deploy, and allows you to...
Git: Guide to Solving Merge Conflicts
Merge Conflicts arise when multiple agents modify the same part of a file and push their changes to a remote branch. When you attempt to merge, pull from or push to these branches - there's a conflict, and Git isn't sure which set of changes to accept and which to...
Data takes many forms - and lists are a very common one. Concatenating strings is a common task and there are several ways to go about it. In the same way, concatenating strings in an array builds upon that task, for each string in that array. However, there's another very...
Keras Callbacks: Save and Visualize Prediction on Each Training Epoch
Keras is a high-level API, typically used with the Tensorflow library, and has lowered the barrier to entry for many and democratized the creation of Deep Learning models and systems. When just starting out, a high-level API that abstracts most of the inner-workings helps people get the hang of the...