Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Data Oriented Programming in Java 21, Solving the Countdown game - JEP Cafe #22

Автор: Java

Загружено: 2024-02-08

Просмотров: 29412

Описание:

In this JEP Café, we will use a lot of the new features added to the JDK in the context of the Data Oriented Programming support: Records, Sealed Types, Pattern Matching, Unnamed Patterns, Exhaustive Switches, as well as the most recent additions to the Stream API: mapMulti(), and Gatherers (a preview feature of the JDK 22). As a bonus, you will see an anonymous class used as a non-denotable type in action, to create a small wrapper on a mutable content. All this is used to solve a funny problem: the Countdown game, where you need to reach a target with a set of randomly drawn numbers, and the four arithmetic operations. Let us check if all this can take us to an efficient, and readable solution.

You can watch all the episodes on the JEP Café series here:    • JEP Café  

You can find the code of this episode here: https://gist.github.com/JosePaumard/e...

⎯⎯⎯⎯⎯⎯ Chapters ⎯⎯⎯⎯⎯⎯

0:00 Do you feel like a coffee break?
0:11 Introducing the Countdown game and its rules
03:01 Introducing the Haskell algorithm translated to Java
04:44 Computing all the permutations of all the subsets
07:20 Splitting the sets to apply the four operations
08:53 Filtering the invalid operations
09:55 Computing the final result and the string of characters
10:21 Using Data Oriented Programming to model the data
12:05 Wrapping up this algorithm
14:49 Writing a bottom up algorithm leveraging Data Oriented Programming
17:32 Using Optional to discard invalid mapping operations
19:30 Getting rid of Optional with Stream.mapMulti()
21:37 Implementing resolve() with an exhaustive switch and pattern matching
23:00 Using a Gatherer to inserting an element at a specific place in a sorted stream
27:18 Using anonymous classes and non-denotable types
28:23 Using the Gatherer in the final process
29:00 Making the algorithm efficient
30:59 Writing the final algorithm using Records
31:50 Comparing the two algorithms
32:33 That's it for today, talk to you soon!

⎯⎯⎯⎯⎯⎯ Resources ⎯⎯⎯⎯⎯⎯

Some amazing Countdown episodes!
◦ 25 50 75 100 3 6 ➱ 952    • Countdown - The Most Extraordinary Numbers...  
◦ 25 50 75 100 1 10 ➱ 813    • Countdown  Amazing Calculation 813 - Carol...  
◦ 100 9 5 10 4 2 ➱ 566    • Carol Vorderman beaten by 11-year-old on C...  
◦ 50 75 100 25 2 1 ➱ 940    • The best numbers game on Countdown 27.10.14  
◦ 75 25 50 100 8 2 ➱ 431    • Letters and Numbers - Lily Serna at her am...  
◦ 25 100 75 50 6 4 ➱ 821    • LETTERS AND NUMBERS - Incredible Maths Cal...  
◦ 3 1 7 8 1 4 ➱ 246    • Nick refuses contestants answer - Countdow...  
More resources on Data Oriented Programming and other subjects covered in this JEP Café
◦ Solving the Countdown problem with Java 21's Language Features by Sundar Athijegannathan ➱ https://inside.java/2023/11/03/countd...
◦ Prof. Graham Hutton ➱ https://www.cs.nott.ac.uk/~pszgmh/
◦ Haskell ➱ https://haskell.org/
◦ Haskell Demo by Prof. Graham Hutton ➱    • FP 2 - Haskell Demo  
◦ The JEP 461 about Stream Gatherers ➱ https://openjdk.org/jeps/461
◦ Nicolai on Gatherers ➱    • Better Java Streams with Gatherers - Insid...   and    • Implementing New Java Stream Operations  
◦ Dev.java ➱ https://dev.java
◦ Inside.java ➱ https://inside.java
◦ JDK 22 ➱ https://openjdk.org/projects/jdk/22
◦ JDK 21 ➱ https://openjdk.org/projects/jdk/21
◦ JDK 17 ➱ https://openjdk.org/projects/jdk/17
◦ OpenJDK ➱ https://openjdk.org
◦ Oracle Java ➱ https://www.oracle.com/java/


Tags: #Java #Java21 #OpenJDK #JDK #JDK21 #JEPCafe #insidejava

Data Oriented Programming in Java 21, Solving the Countdown game - JEP Cafe #22

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Better Java Streams with Gatherers - JEP Cafe #23

Better Java Streams with Gatherers - JEP Cafe #23

1B Rows with the Memory API - JEP Cafe #25

1B Rows with the Memory API - JEP Cafe #25

All New Java Language Features Since Java 21 #RoadTo25

All New Java Language Features Since Java 21 #RoadTo25

Choosing between ArrayList and LinkedList - JEP Cafe #20

Choosing between ArrayList and LinkedList - JEP Cafe #20

Java 25 is HERE!  Top 10 Features That Change EVERYTHING

Java 25 is HERE! Top 10 Features That Change EVERYTHING

Where is the Java language going?

Where is the Java language going?

Ranking Java Features Added from Versions 8 to 21!

Ranking Java Features Added from Versions 8 to 21!

Know Your Java?

Know Your Java?

CppCon 2014: Mike Acton

CppCon 2014: Mike Acton "Data-Oriented Design and C++"

Java 21 New Feature: Sequenced Collections - JEP Cafe #19

Java 21 New Feature: Sequenced Collections - JEP Cafe #19

Valhalla - Java's Epic Refactor

Valhalla - Java's Epic Refactor

Java 21 new feature: Virtual Threads #RoadTo21

Java 21 new feature: Virtual Threads #RoadTo21

Java 21 Pattern Matching Tutorial #RoadTo21

Java 21 Pattern Matching Tutorial #RoadTo21

Java Asynchronous Programming Full Tutorial with Loom and Structured Concurrency - JEP Café #13

Java Asynchronous Programming Full Tutorial with Loom and Structured Concurrency - JEP Café #13

Урок 1. Введение в объектно ориентированное программирование на java.

Урок 1. Введение в объектно ориентированное программирование на java.

Learn how to write fast Java code with the Vector API - JEP Café #18

Learn how to write fast Java code with the Vector API - JEP Café #18

Использование Java 21 для программирования, ориентированного на данные

Использование Java 21 для программирования, ориентированного на данные

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Typst: Современная замена Word и LaTeX, которую ждали 40 лет

Сисадмины больше не нужны? Gemini настраивает Linux сервер и устанавливает cтек N8N. ЭТО ЗАКОННО?

Сисадмины больше не нужны? Gemini настраивает Linux сервер и устанавливает cтек N8N. ЭТО ЗАКОННО?

Vectors in Java: The 1 Situation You Might Want To Use Them

Vectors in Java: The 1 Situation You Might Want To Use Them

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com