stream

Beyond Stream.distinct()

Beyond Stream.distinct()

A Stream of objects Starting with Java 8, you can use a Stream to process elements from a Collection (mostly classes derived from List or Set will be used for this) in an iterating way, defining filtering and mapping lazily, and then "consume" the Stream. You can transform the elements in a Stream for further processing by extracting values from objects (e.g. getting the city name from a person or calculating the length of a string) and filter elements (e.g. only persons older than x years or cities starting with "D") before consuming the resulting Stream of elements. What defines…
Read More
Handling complex events with Bacon.js and combineTemplate

Handling complex events with Bacon.js and combineTemplate

Functional Reactive Programming (FRP) is an advanced programming paradigm that simplifies the management and manipulation of asynchronous events, such as user input or data streams. Bacon.js is a powerful JavaScript library that enables you to implement FRP principles in your web applications effectively. Understanding Functional Reactive Programming (FRP) Functional Reactive Programming is a paradigm that handles events and data streams in a more declarative manner, allowing you to describe the flow of data and reactions to it in a clear and concise way. This approach makes working with asynchronous events more manageable and intuitive, making your code easier to understand…
Read More
Iteration – a Stream Generator for Recursive Minds

Iteration – a Stream Generator for Recursive Minds

The Chores For anyone having been in programming a couple of years, chances are you've run into an interview question or an assignment like iterator for binary tree. There are variants like for the "pre-order", "post-order" or "in-order" traversal; or sometimes you got a n-ary tree instead of a bnary tree. A reason this kind of question is used in interviews is because they require some meticulous attention to details, to make sure you've considered all edge cases etc. Another familiar concept that are sometimes discussed: how do you create a Stream<Integer> representing the (infinite) Fibonacci sequence? The one thing…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.