These are the slides of the talk we made with Stuart Marks at Devoxx Belgium 2018. This first part covers Lambda Expressions and API design with functional interfaces.
What is the state of lambda expressions in Java 11? Lambda expressions are the major feature of Java 8, having an impact on most of the API, including the Streams and Collections API. We are now living the Java 11 days; new features have been added and new patterns have emerged. This highly technical Deep Dive session will visit all these patterns, the well-known ones and the new ones, in an interactive hybrid of lecture and laboratory. We present a technique and show how it helps solve a problem. We then present another problem, and give you some time to solve it yourself. Finally, we present a solution, and open for questions, comments, and discussion. Bring your laptop set up with JDK 11 and your favorite IDE, and be prepared to think!
Lambdas and Streams Master Class Part 2José Paumard
These are the slides of the talk we made with Stuart Marks at Devoxx Belgium 2018. This second part covers the Stream API, reduction and the Collector API.
What is the state of lambda expressions in Java 11? Lambda expressions are the major feature of Java 8, having an impact on most of the API, including the Streams and Collections API. We are now living the Java 11 days; new features have been added and new patterns have emerged. This highly technical Deep Dive session will visit all these patterns, the well-known ones and the new ones, in an interactive hybrid of lecture and laboratory. We present a technique and show how it helps solve a problem. We then present another problem, and give you some time to solve it yourself. Finally, we present a solution, and open for questions, comments, and discussion. Bring your laptop set up with JDK 11 and your favorite IDE, and be prepared to think!
The features released between Java 11 and Java 17 have brought a greater opportunity for developers to improve application development productivity as well and code expressiveness and readability. In this deep-dive session, you will discover all the recent Project Amber features added to the Java language such as Records (including Records serialization), Pattern Matching for `instanceof`, switch expression, sealed classes, and hidden classes. The main goal of the Amber Project is to bring Pattern Matching to the Java platform, which will impact both the language and the JDK APsI. You will discover record patterns, array patterns, as well as deconstruction patterns, through constructors, factory methods, and deconstructors.
You can find the code shown here: https://github.com/JosePaumard/devoxx-uk-2021
Les slides de ma présentation à Devoxx France 2017.
Introduite en Java 8, l'API Collector vit dans l'ombre de l'API Stream, ce qui est logique puisqu'un collecteur doit se connecter à un stream pour fonctionner. Le JDK est organisé de sorte que l'on utilise surtout les collectors sur étagère : groupingBy, counting et quelques autres. Ces deux éléments masquent non seulement le modèle de traitement de données des collectors, mais aussi sa puissance et ses performances.
Ces présentation parle des collectors qui existent et qu'il faut connaître, ceux que l'on peut créer, ceux dont on se doute que l'on peut les créer une fois que l'on comprend un peu les choses, et les autres, tant les possibilités offertes par cette API sont illimitées.
Let's make a contract: the art of designing a Java APIMario Fusco
An API is what developers use to achieve some task. More precisely it establishes a contract between them and the designers of the software exposing its services through that API. In this sense we're all API designers: our software doesn't work in isolation, but becomes useful only when it interacts with other software written by other developers. When writing software we're not only consumers, but also providers of one or more API and that's why every developer should know the features of a good API. During this presentation we will go through real-world examples, also taken from the standard Java API, of good and bad API and comment them in order to show the dos and don'ts of API design. More in general we will discuss the characteristics of an easy and pleasant to use API, like consistency, discoverability and understandability, together with some basic concepts like the principle of least astonishment, and find out how to achieve them.
Java 8 is coming soon. In this presentation I have outlined the major Java 8 features. You get information about interface improvements, functional interfaces, method references, lambdas, java.util.function, java.util.stream
Java 8 Stream API. A different way to process collections.David Gómez García
A look on one of the features of Java 8 hidden behind the lambdas. A different way to iterate Collections. You'll never see the Collecions the same way.
These are the slides I used on my talk at the "Tech Thursday" by Oracle in June in Madrid.
Lambdas and Streams Master Class Part 2José Paumard
These are the slides of the talk we made with Stuart Marks at Devoxx Belgium 2018. This second part covers the Stream API, reduction and the Collector API.
What is the state of lambda expressions in Java 11? Lambda expressions are the major feature of Java 8, having an impact on most of the API, including the Streams and Collections API. We are now living the Java 11 days; new features have been added and new patterns have emerged. This highly technical Deep Dive session will visit all these patterns, the well-known ones and the new ones, in an interactive hybrid of lecture and laboratory. We present a technique and show how it helps solve a problem. We then present another problem, and give you some time to solve it yourself. Finally, we present a solution, and open for questions, comments, and discussion. Bring your laptop set up with JDK 11 and your favorite IDE, and be prepared to think!
The features released between Java 11 and Java 17 have brought a greater opportunity for developers to improve application development productivity as well and code expressiveness and readability. In this deep-dive session, you will discover all the recent Project Amber features added to the Java language such as Records (including Records serialization), Pattern Matching for `instanceof`, switch expression, sealed classes, and hidden classes. The main goal of the Amber Project is to bring Pattern Matching to the Java platform, which will impact both the language and the JDK APsI. You will discover record patterns, array patterns, as well as deconstruction patterns, through constructors, factory methods, and deconstructors.
You can find the code shown here: https://github.com/JosePaumard/devoxx-uk-2021
Les slides de ma présentation à Devoxx France 2017.
Introduite en Java 8, l'API Collector vit dans l'ombre de l'API Stream, ce qui est logique puisqu'un collecteur doit se connecter à un stream pour fonctionner. Le JDK est organisé de sorte que l'on utilise surtout les collectors sur étagère : groupingBy, counting et quelques autres. Ces deux éléments masquent non seulement le modèle de traitement de données des collectors, mais aussi sa puissance et ses performances.
Ces présentation parle des collectors qui existent et qu'il faut connaître, ceux que l'on peut créer, ceux dont on se doute que l'on peut les créer une fois que l'on comprend un peu les choses, et les autres, tant les possibilités offertes par cette API sont illimitées.
Let's make a contract: the art of designing a Java APIMario Fusco
An API is what developers use to achieve some task. More precisely it establishes a contract between them and the designers of the software exposing its services through that API. In this sense we're all API designers: our software doesn't work in isolation, but becomes useful only when it interacts with other software written by other developers. When writing software we're not only consumers, but also providers of one or more API and that's why every developer should know the features of a good API. During this presentation we will go through real-world examples, also taken from the standard Java API, of good and bad API and comment them in order to show the dos and don'ts of API design. More in general we will discuss the characteristics of an easy and pleasant to use API, like consistency, discoverability and understandability, together with some basic concepts like the principle of least astonishment, and find out how to achieve them.
Java 8 is coming soon. In this presentation I have outlined the major Java 8 features. You get information about interface improvements, functional interfaces, method references, lambdas, java.util.function, java.util.stream
Java 8 Stream API. A different way to process collections.David Gómez García
A look on one of the features of Java 8 hidden behind the lambdas. A different way to iterate Collections. You'll never see the Collecions the same way.
These are the slides I used on my talk at the "Tech Thursday" by Oracle in June in Madrid.
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
Introduction to the Thymeleaf java XML/XHTML/HTML5 template engine by José Miguel Samper and Daniel Fernández at Spring I/O 2012 Madrid, Feb 17th 2012.
As presented at DevDuck #6 - JavaScript meetup for developers (www.devduck.pl)
----
Looking for a company to build your app? - Check us out at www.brainhub.eu
Talk given at DevTeach Montreal on RxJS - The Basics & The Future.
Example repo: https://github.com/ladyleet/rxjs-test
Have questions? Find me on twitter http://twitter.com/ladyleet
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Here I discuss about reactive programming, observable, observer and difference between observable and promise.
Also discuss some of important operators like forkJoin, switchMap, from, deboucneTime, discardUntilChanged, mergeMap. I discuss some of observable creation function.
HashMap is a part of Java's collection.. It provides the basic implementation of Map interface of Java. It stores the data in (Key, Value) pairs. To access a value key should be known. This ppt dives deep into the internal working of Hashmaps.
The features released between Java 11 and Java 17 have brought a greater opportunity for developers to improve application development productivity as well and code expressiveness and readability. In this deep-dive session, you will discover all the recent Project Amber features added to the Java language such as Text blocks, Records (including Records serialization), Pattern Matching for instanceof, switch expression, sealed classes, and pattern matching for switch. The main goal of the Amber Project is to bring Pattern Matching to the Java platform, which will impact both the language and the JDK APIs. You will discover record patterns, array patterns, as well as deconstruction patterns, through constructors, factory methods, and deconstructors.
JavaScript - Chapter 9 - TypeConversion and Regular Expressions WebStackAcademy
Type Conversion:
JavaScript is loosely typed language and most of the time operators automatically convert a value to the right type but there are also cases when we need to explicitly do type conversions.
While JavaScript provides numerous ways to convert data from one type to another but there are two most common data conversions :
Converting Values to String
Converting Values to Numbers
Regular Expressions:
A regular expression is an object that describes a pattern of characters.
The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on text.
We like the architecture of our applications to revolve around the business logic, not around technical details (and especially not around the database).
In my team at Sky Network Services we use the Clean Architecture and it has given us a great deal of benefits: the business logic is explicit, we are free to change our technical decisions, the app is easy to test, working on it is faster and scalable, it’s hard to do the wrong thing, and many more.
But it comes at a cost, of course. In this talk I’ll tell you the story of our experience with Clean Architecture and give you some tips to get the most out of it.
Example Project
https://github.com/mattia-battiston/clean-architecture-example
Downloads
Online: https://goo.gl/DTxftJ
PDF: https://goo.gl/ZAtdBN
Powerpoint: https://goo.gl/D54wdZ (but you need to install these fonts to see it properly: https://goo.gl/iH8SO5)
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
Introduction to the Thymeleaf java XML/XHTML/HTML5 template engine by José Miguel Samper and Daniel Fernández at Spring I/O 2012 Madrid, Feb 17th 2012.
As presented at DevDuck #6 - JavaScript meetup for developers (www.devduck.pl)
----
Looking for a company to build your app? - Check us out at www.brainhub.eu
Talk given at DevTeach Montreal on RxJS - The Basics & The Future.
Example repo: https://github.com/ladyleet/rxjs-test
Have questions? Find me on twitter http://twitter.com/ladyleet
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Here I discuss about reactive programming, observable, observer and difference between observable and promise.
Also discuss some of important operators like forkJoin, switchMap, from, deboucneTime, discardUntilChanged, mergeMap. I discuss some of observable creation function.
HashMap is a part of Java's collection.. It provides the basic implementation of Map interface of Java. It stores the data in (Key, Value) pairs. To access a value key should be known. This ppt dives deep into the internal working of Hashmaps.
The features released between Java 11 and Java 17 have brought a greater opportunity for developers to improve application development productivity as well and code expressiveness and readability. In this deep-dive session, you will discover all the recent Project Amber features added to the Java language such as Text blocks, Records (including Records serialization), Pattern Matching for instanceof, switch expression, sealed classes, and pattern matching for switch. The main goal of the Amber Project is to bring Pattern Matching to the Java platform, which will impact both the language and the JDK APIs. You will discover record patterns, array patterns, as well as deconstruction patterns, through constructors, factory methods, and deconstructors.
JavaScript - Chapter 9 - TypeConversion and Regular Expressions WebStackAcademy
Type Conversion:
JavaScript is loosely typed language and most of the time operators automatically convert a value to the right type but there are also cases when we need to explicitly do type conversions.
While JavaScript provides numerous ways to convert data from one type to another but there are two most common data conversions :
Converting Values to String
Converting Values to Numbers
Regular Expressions:
A regular expression is an object that describes a pattern of characters.
The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on text.
We like the architecture of our applications to revolve around the business logic, not around technical details (and especially not around the database).
In my team at Sky Network Services we use the Clean Architecture and it has given us a great deal of benefits: the business logic is explicit, we are free to change our technical decisions, the app is easy to test, working on it is faster and scalable, it’s hard to do the wrong thing, and many more.
But it comes at a cost, of course. In this talk I’ll tell you the story of our experience with Clean Architecture and give you some tips to get the most out of it.
Example Project
https://github.com/mattia-battiston/clean-architecture-example
Downloads
Online: https://goo.gl/DTxftJ
PDF: https://goo.gl/ZAtdBN
Powerpoint: https://goo.gl/D54wdZ (but you need to install these fonts to see it properly: https://goo.gl/iH8SO5)
COS30008 Semester 1, 2016 Dr. Markus Lumpe 1 Swinbu.docxvanesaburnand
COS30008 Semester 1, 2016 Dr. Markus Lumpe
1
Swinburne University Of Technology
Faculty of Science, Engineering and Technology
ASSIGNMENT COVER SHEET
Subject Code: COS30008
Subject Title: Data Structures & Patterns
Assignment number and title: 6 – Copy Control & Container Types
Due date: May 16, 2016, 16:30
Lecturer: Dr. Markus Lumpe
Your name: Your student id:
Check Tutorial
Tues 17:30 Wed 08:30 Wed 12:30 Wed 14:30 Thurs 12:30
Marker's comments:
Problem Marks Obtained
1 23
2 17
3 18
Extra Credit 1 17
Extra Credit 2 18
Total 58
Extension certification:
This assignment has been given an extension and is now due on
Signature of Convener:
COS30008 Semester 1, 2016 Dr. Markus Lumpe
2
Problem Set 6: Copy Control & Container Types
Preliminaries
Review the solution of tutorial 9, the List ADT (part A), the lecture material regarding the
construction of an abstract data type, and how copy control is achieved for a given data
type (see tutorial 10 in which we equipped class SimpleString with proper copy control).
Problem 1:
Add proper copy control to the template class List.
#pragma once
#include "DoublyLinkedNode.h"
#include "DoublyLinkedNodeIterator.h"
#include <stdexcept>
template<class T>
class List
{
private:
// auxiliary definition to simplify node usage
typedef DoublyLinkedNode<T> Node;
Node* fTop; // the first element in the list
Node* fLast; // the last element in the list
int fCount; // number of elements in the list
public:
// auxiliary definition to simplify iterator usage
typedef DoublyLinkedNodeIterator<T> Iterator;
List(); // default constructor - creates empty list
~List(); // destructor - frees all nodes
// copy control features (destructor is given)
List( const List& aOtherList ); // copy constructor
List& operator=( const List& aOtherList ); // assignment operator
bool isEmpty() const; // Is list empty?
int size() const; // list size
// adds a node initialized with aElement at front
void push_front( const T& aElement );
// adds a node initialized with aElement at back
void push_back( const T& aElement );
// removes node that matches aElement from list
void remove( const T& aElement );
const T& operator[]( unsigned int aIndex ) const; // list indexer
// returns an iterator for the nodes of the list
Iterator getIterator() const;
};
#include "ListLab9.h" // solution Lab9
#include "ListPS6.h" // your solution PS6
COS30008 Semester 1, 2016 Dr. Markus Lumpe
3
Test harness
string s1( "AAAA" );
string s2( "BBBB" );
string s3( "CCCC" );
string s4( "DDDD" );
string s5( "EEEE" );
List<string> lList;
lList.push_front( s4 );
lList.push_front( s3 );
lList.push_front( s2 );
List<string> copy( lList );
// iterate from the top
cout << "A .
Unit testing with PHPUnit - there's life outside of TDDPaweł Michalik
Basics of PHPUnit and why is it even more relevant in legacy code. Key points of the framework are explained, along with mocking objects, test organisation, creating documentations with tests and accessing non-public objects (where applicable).
Live version with additional notes available at: http://pawelmichalik.net/presentations/unit-testing-with-phpunit?showNotes=true
Prezentacja dostępna także w języku polskim: http://pawelmichalik.net/prezentacje/testy-jednostkowe-w-phpunit?showNotes=true
React mit TypeScript – eine glückliche Eheinovex GmbH
In seiner Brownbag sprach inovexler Johann über die Verwendung von TypeScript in einer React-Anwendung.
Als Java-Land Immigrant mit Typisierungshintergrund, fällt es einem in der neuen JavaScript-Welt erstmal schwer auf etablierte Refactoring-Traditionen und die gute, alte Code-Literatur zu verzichten. TypeScript bringt verloren geglaubte Möglichkeiten zurück und ist auch zu React eine willkommene Bereicherung.
In diesem Vortrag wird gezeigt, wie man möglichst einfach ein React-Projekt mit TypeScript aufsetzt, einfache Typisierungsregeln etabliert und bekannte Bibliotheken integriert.
Event: Brownbag bei inovex
Speaker: Johann Böhler, inovex
Datum: 25.06.2018
Weitere Tech-Vorträge: https://www.inovex.de/de/content-pool/vortraege/
Weitere Tech-Artikel: www.inovex.de/blog
This presentaion provides and overview of the new features of Java 8, namely default methods, functional interfaces, lambdas, method references, streams and Optional vs NullPointerException.
This presentation by Arkadii Tetelman (Lead Software Engineer, GlobalLogic) was delivered at Java.io 3.0 conference in Kharkiv on March 22, 2016.
RSpock is a testing and specification framework built on top of Minitest. It intends to give back productivity to its users with its incredibly simple yet highly expressive specification language.
Note: RSpock is heavily inspired by Spock for the Groovy programming language.
The Loom project has been under work for many years, and just delivered Virtual Threads as a preview feature in the JDK 19. We now have a very precise idea of what they are and what you can do with them. Our good old Threads, created more than 25 years ago, will see a new kind of lightweight threads. This presentation shows you that creating a thread is easier and much cheaper, allowing the creation of millions of them in a single JVM. These virtual threads can be block at almost no cost. These new virtual threads bring with them new notions that will be covered in this talk. Loom threads are coming, and they will change the landscape of concurrent programming in Java.
The Future of Java: Records, Sealed Classes and Pattern MatchingJosé Paumard
The release of the JDK 17 brings interesting features in the Java language: sealed types and pattern matching for switch. Along with the introduction of records, the implementation of pattern matching in the Java language begins to take shape. This presentation shows you how records, sealed types, and pattern matching can change the way we write Java code, on real patterns. It also shows you what we can expect to see on this topic in the future. It is mostly a live coding presentation, with some slides when the code is shown cannot be executed.
Designing functional and fluent API: application to some GoF patternsJosé Paumard
These are the slides of my Devnexus 2020 talk. The code is avaiblable on my GitHub account: https://github.com/JosePaumard/devnexus-2020-visitor-lambda. You can see a replay of this talk (in a slightly different version) here: https://youtu.be/gq23w9nycBs
Those are the slides of the presentation we made with Maurice Naftalin à Goto: Copenhagen 2019.
Functional programmers have been saying for decades that they know the way to the future. Clearly they've been wrong, since imperative languages are still far more popular. Clearly they've also been right, as the advantages of functional programming have become increasingly obvious. Is it possible to combine the two models? Scala is one language that does this, and Java too has been on a journey, which still continues, of learning from functional languages and carefully adding features from them. In this talk, we'll review what Java has learned from functional languages, what it can still learn, and how its added features compare to Scala's original ones.
Slides from the talk we did with Maurice Naftalin for Devoxx Belgium 2019.
Functional programmers have been saying for decades that they know the way to the future.
Clearly they have been wrong, since imperative languages are still far more popular.
Clearly they have also been right, as the advantages of functional programming have become increasingly obvious. Is it possible to face both ways, and combine the two models?
Scala is one language that does this, and Java too has been on a journey, which still continues, of learning from functional languages and carefully adding features from them.
In this talk, we will review what Java has learned from functional languages, what it can still learn, and how its added features compare to Scala's original ones.
Designing functional and fluent API: example of the Visitor PatternJosé Paumard
This is the slide deck of my talk from Devoxx Belgium 2019. You can watch the video here https://www.youtube.com/watch?v=gq23w9nycBs and get the code here: https://github.com/JosePaumard/devoxx-belgium-2019-visitor-lambda.
Among the patterns from the GoF, the Visitor is probably the more complex to implement. One of the difficulties is that you need to implement it in your object model, leading to complex refactoring for legacy applications. Based on the use of all the nifty tools brought by functional programming: chaining, composition, and partial application, you can implement Visitors without having to change your object model, using a functional and fluent API. This approach can be used to implement other patterns: Builder and Validator. Using this way of designing API leads to readable and robust code, designed following the GoF patterns.
Les slides du Tools in Action que j'ai donné à Devoxx France 2019.
Le JDK est open source et son développement aussi. L'ensemble des nouveautés vit sur des branches Mercurial qui peuvent être téléchargées et compilées à la demande. Cela permet de jouer avec des fonctionnalités encore en chantier, de regarder comment les nouvelles syntaxes fonctionneront, bref, de jouer avec un JDK du futur, qui n'existera peut-être jamais. L'objet de ce tools in action est simple : montrer comment tout ceci fonctionne, de l'installation d'une machine Ubuntu à l'exécution d'un JDK recompilé maison.
Le slide deck de l'Université que nous avons donnée avec Rémi Forax à Devoxx France 2019.
Comme promis, Java sort sa version majeure tous les 6 mois. Le train passe et amène son lot de nouveautés. Parmi elles, certaines sont sorties : une nouvelle syntaxe pour les clauses switch et l'instruction de byte code CONSTANT_DYNAMIC. D'autres sont en chantier, plus ou moins avancé : une nouvelle façon d'écrire des méthodes de façon condensée, un instanceof 'intelligent', des constantes évaluées au moment où elles sont utilisées. Les projets progressent. Loom, et son nouveau modèle de programmation concurrente que l'ont peut tester avec Jetty. Amber, qui introduit les data types et des nouvelles syntaxes. Valhalla, dont les value types donnent leurs premiers résultats. S'il est difficile de prévoir une date de sortie pour ces nouveautés, on sait en revanche qu'une fois prêtes elles sortiront en moins de 6 mois. De tout ceci nous parlerons donc au futur et en public, avec des démonstrations de code, des slides, du code, de la joie et de la bonne humeur !
Slides of the talk we gave with David Delabassee at Oracle Code One 2018.
The FnProject was released about a year ago, proposing new ways to design asynchronous systems in a very flexible way. This tutorial shows you how to set up a Fn Server on a local development machine running Windows with a first simple function. Then we cover the design of multi-functions systems, connected together in an asynchronous way, leveraging the Fn Flow API. This API is first presented, including how it compares to the the Java 8 CompletableFuture API. We then set up a real example made of several functions, producing multiple results and see how we can leverage their asynchronous nature to make a non-blocking system, handling errors in a simple and intuitive way. Most of the examples are shown both on slides and live coding parts.
Avec la version 9 sortie en septembre 2017, Java appuie sur la pédale ! Le rythme des livraisons passe à une version majeure tous les 6 mois. Java 10 est sorti en mars, prochaine version en septembre. Java 10 apporte le 'var' et l'inférence de type pour les variables locales. D'autres nouveautés sont en préparation : les constantes dynamiques, les classes de données, un nouveau switch à base de lambda, des interfaces fermées, de nouvelles choses du coté des génériques et bien plus encore.
Cela viendra-t-il en 11, 12, 15 ? Ne spéculons pas, mais quand ces nouveautés seront prêtes, elles sortiront en quelques mois. On se propose de présenter ces nouveautés, celles qui sont presque prêtes, celles qui seront prêtes bientôt, et celles qui ne seront pas prêtes avant un moment. Quels seront les impacts sur le langage, sur la JVM et donc sur les performances ? Que cela va-t-il nous apporter au quotidien, en tant que développeurs ? Quels seront les nouveaux patterns ? Voici le programme de cette présentation, avec des slides, du code, de la joie et de la bonne humeur !
JAX-RS and CDI Bike the (Reactive) BridgeJosé Paumard
This session explains how JAX-RS and CDI became reactive capable in Java EE 8. We put some new features of JAX-RS 2.1 and CDI 2.0 into perspective and show some reactive patterns to improve your application. Add Java 8 CompletionStage to the mix and this API trio becomes your best bet to easily go reactive without leaving the Java EE train.
The slides of my talk at Devoxx BE 2017. This in depth talk is all about collectors: those available, because we need to know them, those that we can create, those we had no idea they could be created, and the others, as there is in fact no limit to what can be done with this API. The concept of downstream collector will be used to show how we can write entire data processing pipelines using collectors only, and pass them as parameters to other pipelines.
The slides of my Java One 2017 talk about the Spliterator Patterns, or, how to extend the Stream API using the Spliterator API.
The video is available on YouTube: https://www.youtube.com/watch?v=xgHGpsubL5M
The slides of my JavaOne 2017 talk. It describes how you can create API using functional interfaces, default and static methods starting with Java 8. You can watch the video here: https://www.youtube.com/watch?v=64UO1YjVcZ0
The slides of my university talk, Devoxx Belgium 2016.
The goal of this talk is to compare the two most popular implementations of List: LinkedList and ArrayList, and provide hints on which one to use in what case.
The slides of my JavaOne 2016 talk. This talk is a tutorial on how to write lambda expressions, how to compose them using default methods in functional interfaces, and how to create factory methods in those interfaces. Many examples and patterns are provided.
ArrayList et LinkedList sont dans un bateauJosé Paumard
Slides de mon université à Devoxx France 2016. Le sujet est la performance des algorithmes d'implémentation de List et leur adéquation avec la structure des CPU actuels.
Slides of the talk we made with David Delabasee (@delabassee) at Devoxx 2015. A list of Java SE 8 patterns that you can use in Java EE 7 applications, thanks to the support of the major app servers.
Asynchronous API in Java8, how to use CompletableFutureJosé Paumard
Slides of my talk as Devoxx 2015. How to set up asynchronous data processing pipelines using the CompletionStage / CompletableFuture API, including how to control threads and how to handle exceptions.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
5. #LambdaHOL#Devoxx
The LambdaHOL
8 test classes, with 80 exercises to complete
- Lambda, functionnal interfaces
- Comparators
- Streams, Collectors
- Some challenges at the end
- Updated regularly
With solutions!
17. #LambdaHOL#Devoxx
1st example
A consumer that clears a string builder
@Test
public void consumer_1() {
Consumer<List<String>> consumer = null; // TODO
List<String> list =
new ArrayList<>(Arrays.asList("a", "b", "c"));
consumer.accept(list);
assertThat(list).isEmpty();
}
18. #LambdaHOL#Devoxx
2nd example
A consumer that calls two Consumers
@Test
public void consumer_2() {
Consumer<List<String>> c1 = list -> list.add("first");
Consumer<List<String>> c2 = list -> list.add("second");
Consumer<List<String>> consumer; // TODO
List<String> list =
new ArrayList<>(Arrays.asList("a", "b", "c"));
consumer.accept(list);
assertThat(list).containsExactly("a", "b", "c", "first", "second");
}
20. #LambdaHOL#Devoxx
1st example
A predicate that negates another predicate
@Test
public void predicate_1() {
Predicate<String> predicate = s -> s.isEmpty();
Predicate<String> notPredicate; // TODO
assertThat(notPredicate.test("")).isFalse();
assertThat(notPredicate.test("Not empty!")).isTrue();
}
21. #LambdaHOL#Devoxx
2nd example
A predicate that is true if a string is non null
and non empty
@Test
public void predicate_2() {
Predicate<String> p1 = s -> s != null;
Predicate<String> p2 = s -> s.isEmpty();
Predicate<String> p3; // TODO
assertThat(p3.test("")).isFalse();
assertThat(p3.test(null)).isFalse();
assertThat(p3.test("Not empty!")).isTrue();
}
22. #LambdaHOL#Devoxx
3rd example
How to design a xOr() method on Predicate?
@Test
public void predicate_3() {
Predicate<String> p1 = s -> s.length() == 4;
Predicate<String> p2 = s -> s.startsWith("J");
Predicate<String> p3; // TODO
assertThat(p3.test("True")).isTrue();
assertThat(p3.test("Julia")).isTrue();
assertThat(p3.test("Java")).isFalse();
}
24. #LambdaHOL#Devoxx
A first example
What is this code doing?
Comparator<Person> cmp = new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.getLastName().compareTo(p2.getLastName());
}
};
25. #LambdaHOL#Devoxx
A first example
What is this code doing?
Comparator<Person> cmp = new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
int cmp = p1.getLastName().compareTo(p2.getLastName());
if (cmp == 0) {
return p1.getFirstName().compareTo(p2.getFirstName());
} else {
return cmp;
}
}
};
26. #LambdaHOL#Devoxx
A first example
What is this code doing?Comparator<Person> cmp = new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
int cmp = p1.getLastName().compareTo(p2.getLastName());
if (cmp == 0) {
cmp = p1.getFirstName().compareTo(p2.getLastName());
if (cmp == 0) {
return Integer.compare(p1.getAge(), p2.getAge());
} else {
return cmp;
}
} else {
return cmp;
}
}
};
27. #LambdaHOL#Devoxx
A first example
What is this code doing?Comparator<Person> cmp = new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
int cmp = p1.getLastName().compareTo(p2.getLastName());
if (cmp == 0) {
cmp = p1.getFirstName().compareTo(p2.getFirstName());
if (cmp == 0) {
return Integer.compare(p1.getAge(), p2.getAge());
} else {
return cmp;
}
} else {
return cmp;
}
}
};
28. #LambdaHOL#Devoxx
A first example
What is this code doing?
Comparator<Person> cmp = Comparator.comparing(Person::getLastName)
.thenComparing(Person::getFirstName)
.thenComparing(Person::getAge);
29. #LambdaHOL#Devoxx
1st example
A comparator that puts null values at the end
Person michael = new Person("Michael", "Jackson", 51);
Person rod = new Person("Rod", "Stewart", 71);
Person paul = new Person("Paul", "McCartney", 74);
Person mick = new Person("Mick", "Jagger", 73);
Person jermaine = new Person("Jermaine", "Jackson", 61);
@Test
public void comparator_1() {
Comparator<Person> cmp = null; // TODO
assertThat(cmp.compare(michael, rod)).isLessThan(0);
assertThat(cmp.compare(paul, paul)).isEqualTo(0);
assertThat(cmp.compare(michael, jermaine)).isGreaterThan(0);
assertThat(cmp.compare(mick, null)).isLessThan(0);
assertThat(cmp.compare(null, mick)).isGreaterThan(0);
}
32. #LambdaHOL#Devoxx
A Currency Converter
… write the following currency converter:
LocalDate date = ...;
CurrencyConverter plnToAud =
CurrencyConverter.of(date)
.from("PLN")
.to("AUD");
float pln = ...;
float aud = plnToAud.convert(pln);
33. #LambdaHOL#Devoxx
A Validator
Given the following bean
public class Person {
private String lastName ;
private int age ;
// getters, setters, constructeurs
}
34. #LambdaHOL#Devoxx
A Validator
Implement the following pattern
If the user is not valid: get() throws an exception, with all
the exceptions of each validator in the suppressed
exceptions
Validator<Person> validator = Validator.
.firstValidate(p -> p.getName() == null, "name is null")
.thenValidate(p -> p.getAge() < 0, "age is negative")
.thenValidate(p -> p.getAge() > 150, "age is greater than
150");
person = validator.validate(person).get();
35. #LambdaHOL#Devoxx
A Validator
If the user is not valid: get() throws an exception, with all
the exceptions of each validator in the suppressed
exceptions
Validator<Person> validator =
Validator
.firstValidate(p -> p.getName() == null, "name is null")
.thenValidate(p -> p.getAge() < 0, "age is negative")
.thenValidate(p -> p.getAge() > 150, "age is greater than 150");
person = validator.validate(person).get();
36. #Devoxx
Don’t miss the 2nd day:
1) More functional
programming!
2) Stream, reduction
3) Collectors
Day break!