• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    Java
  • Created almost 11 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Examples of Java 8, lambdas, Streams and Collectors stuff I show as examples during my talks.

This repository contains example files I use in my JDK8 / Lambdas / Streams / Collectors talks.

The data files mcdonalds.csv, movies-mpaa.txt, ospd.txt and words.shakespeare.txt can be freely downloaded from Robert Sedgwick page here: http://introcs.cs.princeton.edu/java/data/. By the way, there are other very interesting data sets on this page.

You can find 3 examples here :

  • the Scrabble example, or "how good at Scrabble Shakespeare would have been?"
  • the MacDonald example, or "Houston, we've got a problem"
  • the Movie database example.

All files are provided under the GPL license. All data sets files are under the copyright of their authors, and provided for convenience only.

More on "how good at Scrabble Shakespeare would have been". I realized that the best words are in fact not playable in Scrabble : not enough letters to place buzzards and whizzing on a Scrabble board. But there are two blanks letters in the Scrabble game. So let's take into account that in fact, buzzards and whizzing are doable with blank letters, and let's change the computation of the score to take into account that the blank letters score 0.

Nice little problem, and it turns out that it is still solvable with a map / filter / reduce approach, thus fully lambda based. Great !

More on the Movie database example.

A nice question I had on this example is : "and how about the most seen duo of actors". This question is pretty straigthforward if your actors are in a DB with a basic SQL engine. With the Stream API, it's a bit trickier, and cant be solved using a brute force method, due to the number of cases to evaluate. There's no Collector for that, to we have to build our own. And if we want to go parallel, we need to be careful about using concurrent structures.

More Repositories

1

streams-utils

Streams Utils is a set of operations written on Java 8 Streams. It allows several basic operations that are not available in the the Java 8, and that have proven to be very useful in some cases. It is an updated version of More Spliterators.
Java
192
star
2

lambda-master-class-part1

Java
64
star
3

code-one-2019-lambda-stream-collector-lab

Java
36
star
4

Loom_demo

Java
34
star
5

collectors-utils

CollectorsUtils is a factory class that provides collectors for the JDK 8 Stream API.
Java
29
star
6

tests-pour-parcoursup

Java
24
star
7

JosePaumard.github.io

23
star
8

lambda-master-class-part2

Java
23
star
9

JDK20_2023-Loom-Lab

Java
22
star
10

devoxx-be-2017

This repo is an extended and somehow cleaned up version of the live coding sessions I made for my talk Collectors in the Wild at Devoxx Belgium 2017.
Java
16
star
11

jdk8-stream-rx-comparison

Java
15
star
12

devoxx-belgium-2019-visitor-lambda

Java
11
star
13

more-spliterators

More Spliteratos is a set of operations written on Java 8 Streams. It allows several basic operations that are not available in the the Java 8, and that have proven to be very useful in some cases.
Java
10
star
14

devnexus-2020-visitor-lambda

Code for the talk I gave at Devneux 2020.
Java
7
star
15

devoxx-france-2019-master-class

Repository used for a Lambda / Streams / Collectors presentation at Devoxx France 2019
Java
6
star
16

2021_Chti-JUG-live-demo

Java
6
star
17

jdk8-spliterators

Java
5
star
18

equivalent-mutants

A small project based on the Rental Movie refactoring kata created by Martin Fowler, use to show equivalent mutants for Pitest.
Java
5
star
19

silly-lambda-collections

This is the code from my Devoxx France 2016 University. The slides are here: http://fr.slideshare.net/jpaumard/arraylist-et-linkedlist-sont-dans-un-bateau.
Java
5
star
20

jep-cafe-04-jpackage

Java
4
star
21

devoxx-uk-2021

Java
3
star
22

jep-cafe-03

Java
2
star
23

jep-cafe-07-string-concatenation

Java
2
star
24

2022_DevNexus-lab

Java
2
star
25

jdk8-stream-rx-comparison-reloaded

A copy of jdk8-stream-rx-comparison under an Apache 2.0 licence.
Java
2
star
26

data-tp

2
star
27

2022_javaone-loom-livelab

Java
1
star
28

VTS_CompletableFuture

Java
1
star