The document discusses reactive programming and ranges in C++. It begins by defining reactive as responding to stimuli and describes approaches like signals/slots in Qt and event listeners in other languages. It then discusses issues with threads and how futures can provide a better abstraction for concurrency. The document introduces ranges for working with sequences of values and shows examples of transformations like map, filter, and flatmap. It proposes modeling asynchronous data streams in C++ using futures and function objects to allow reactive programming with streams.
Logic-based program transformation in symbiosis with EclipseCoen De Roover
"Logic-based program transformation in symbiosis with Eclipse" as presented at the 2011 Seminar Series on Advanced Techniques & Tools for Software Evolution in Koblenz.
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The document discusses processes and process interactions. It defines processes as activities executing on a CPU that conceptually run concurrently. Processes can compete for resources or cooperate through synchronization. Basic synchronization techniques discussed include semaphores, which are integers that processes operate on to synchronize access to shared resources through wait and signal operations. Producer-consumer problems are provided as examples where semaphores can be used for processes to cooperate. Event synchronization constructs like wait and post are also summarized for synchronizing on asynchronous events.
The document summarizes Tiark Rompf's talk on using the Delite framework to build domain-specific languages (DSLs) that can be optimized and compiled to different low-level architectures. It provides examples of existing DSLs created with Delite for machine learning, data querying, graph analysis, and collections. The talk discussed how DSLs allow writing programs at a high-level that can then be optimized and generated into high-performance code.
This presentation introduces the concept of synchronization beatween threads, as implemented in the Java platform. It is the second part of a series of slides dedicated to thread synchronization. This slides introduces the following concepts:
- Conditional locking
- Volatile variables
- Thread confinement
- Immutability
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the concept of synchronization beatween threads, as implemented in the Java platform. It is the first part of a series of slides dedicated to thread synchronization. This slides introduces the following concepts:
- Thread safety
- Types of race conditions
- Locking (reentrant locks, intrinsic locks, synchronized blocks)
- Locking pitfalls
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This document discusses Java concurrency. It begins with an agenda and then covers key topics like shared state, thread safety, concurrency problems and symptoms, and Java concurrency methods. Facts about processors, caches and memory interactions that can impact concurrency are presented. Examples are provided to illustrate concurrency issues like visibility and atomicity. Common concurrency problems like invalid states and their symptoms are outlined. Finally, Java concurrency methods like thread confinement, immutability, volatile variables, and synchronized are defined and code examples are shown.
This document discusses processes and their interaction in operating systems. It defines a process as a program in execution that includes code, data, threads of execution, and resources. It describes how operating systems virtualize CPUs and memory to allow multiple processes to run concurrently. It discusses different types of process interactions including competition over shared resources, which can cause race conditions, and cooperation through synchronization and message passing. It presents several algorithms to solve the critical section problem of mutual exclusion when processes access shared resources.
Logic-based program transformation in symbiosis with EclipseCoen De Roover
"Logic-based program transformation in symbiosis with Eclipse" as presented at the 2011 Seminar Series on Advanced Techniques & Tools for Software Evolution in Koblenz.
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The document discusses processes and process interactions. It defines processes as activities executing on a CPU that conceptually run concurrently. Processes can compete for resources or cooperate through synchronization. Basic synchronization techniques discussed include semaphores, which are integers that processes operate on to synchronize access to shared resources through wait and signal operations. Producer-consumer problems are provided as examples where semaphores can be used for processes to cooperate. Event synchronization constructs like wait and post are also summarized for synchronizing on asynchronous events.
The document summarizes Tiark Rompf's talk on using the Delite framework to build domain-specific languages (DSLs) that can be optimized and compiled to different low-level architectures. It provides examples of existing DSLs created with Delite for machine learning, data querying, graph analysis, and collections. The talk discussed how DSLs allow writing programs at a high-level that can then be optimized and generated into high-performance code.
This presentation introduces the concept of synchronization beatween threads, as implemented in the Java platform. It is the second part of a series of slides dedicated to thread synchronization. This slides introduces the following concepts:
- Conditional locking
- Volatile variables
- Thread confinement
- Immutability
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the concept of synchronization beatween threads, as implemented in the Java platform. It is the first part of a series of slides dedicated to thread synchronization. This slides introduces the following concepts:
- Thread safety
- Types of race conditions
- Locking (reentrant locks, intrinsic locks, synchronized blocks)
- Locking pitfalls
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This document discusses Java concurrency. It begins with an agenda and then covers key topics like shared state, thread safety, concurrency problems and symptoms, and Java concurrency methods. Facts about processors, caches and memory interactions that can impact concurrency are presented. Examples are provided to illustrate concurrency issues like visibility and atomicity. Common concurrency problems like invalid states and their symptoms are outlined. Finally, Java concurrency methods like thread confinement, immutability, volatile variables, and synchronized are defined and code examples are shown.
This document discusses processes and their interaction in operating systems. It defines a process as a program in execution that includes code, data, threads of execution, and resources. It describes how operating systems virtualize CPUs and memory to allow multiple processes to run concurrently. It discusses different types of process interactions including competition over shared resources, which can cause race conditions, and cooperation through synchronization and message passing. It presents several algorithms to solve the critical section problem of mutual exclusion when processes access shared resources.
The document analyzes potential issues found by PVS-Studio in various KDE projects and libraries. It identifies several types of issues, including expressions that are always true or false, unsafe pointer usage before validation, missing keywords that could alter program logic, and unsafe realloc() usage. A total of 27 specific code fragments are highlighted across the different libraries and applications as demonstrating these kinds of issues.
This presentation introduces the Java concept of thread. It is the first part of a series of slides dedicated to concurrent programming. This slides introduces some basics concepts, such as:
- Differences between processes and threads
- Thread's basics
- Thread's states
- Introduction to UML sequence diagrams
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The new Actor representation in Akka Typed allows formulations that lend themselves to monadic interpretation or introspection. This leads us to explore possibilities for expressing and verifying dynamic properties like the adherence to a communication protocol between multiple agents as well as the safety properties of that protocol on a global level. Academic research in this area is far from complete, but there are interesting initial results that we explore in this session: precisely how much purity and reasoning can we bring to the distributed world?
Threads, Events, Signals/Slots provides an overview of multithreaded programming in QT including:
1) QT supports threading through the QThread class and provides thread safe APIs like QMutex. GUI operations are only allowed on the main thread.
2) QT uses an event-based model where events are processed in an event loop. Events can be used for intra-thread and inter-thread communication.
3) Signals and slots provide a type-safe mechanism for loose coupling between objects and allow one-to-many and many-to-one communication. They are mapped to events and processed in the receiving object's thread.
This document provides an overview of the FreeRTOS real-time operating system. It discusses FreeRTOS's task management features including task creation, states, data structures, and blocking behavior. It describes how tasks can create other tasks and pass parameters. It also summarizes FreeRTOS configuration options, licensing, and commercial variants.
Whats New in Visual Studio 2012 for C++ DevelopersRainer Stropek
For a Microsoft event we have been hired to do a full-day workshop about news in Visual Studio 2012 for C++ developers. My colleague Philipp Aumayr conducted the workshop. Here are the slides for his talk. More details including sample code can be found in our developer blog at http://www.software-architects.com
How to write multi threaded applications using Qt:
In the slides you'll learn about 3 alternatives, all of which allow running tasks simultaneously in Qt applications, and understand the use cases leading to choosing each.
L Fu - Dao: a novel programming language for bioinformaticsJan Aerts
The document introduces Dao, a new programming language for bioinformatics. It discusses Dao's key features like optional typing, native support for concurrent programming, an LLVM-based JIT compiler, simple C interfaces, and the ClangDao tool for wrapping C/C++ libraries. An example demonstrates using thread tasks and futures for concurrent programming. The document outlines future plans to develop BioDao, an open source project providing bioinformatics modules to the Dao language.
Tesseract. Recognizing Errors in Recognition SoftwareAndrey Karpov
Tesseract is a free software program for text recognition developed by Google. According to the project description, "Tesseract is probably the most accurate open source OCR engine available". And what if we try to catch some bugs there with the help of the CppCat analyzer?
This document provides an overview of a tutorial on VHDL synthesis, place and route for FPGA and ASIC technologies. The tutorial covers VHDL coding styles, FPGA synthesis, place and route, a demo of FPGA synthesis and place and route, ASIC synthesis, place and route, and a demo of ASIC synthesis and place and route. The outline indicates it will also cover conclusions and further reading.
The document discusses various techniques for implementing reflection in object-oriented programming languages like Smalltalk. It describes approaches for controlling message passing through minimal objects, anonymous classes, and method substitution. Minimal objects intercept messages using doesNotUnderstand:, while anonymous classes are inserted between instances and their classes to control lookup. Method substitution directly replaces methods to add control. The document analyzes the tradeoffs of different reflective approaches.
The document discusses behavioral reflection and metaprogramming techniques in Smalltalk. It introduces sub-method structures like bytecode, the ByteSurgeon library for bytecode transformation, and Geppetto which enables partial behavioral reflection through hooksets and metaobjects. This allows profiling and caching to be selectively added to applications at runtime without restarting the system. Future work includes improving tool support and integrating with AST representations.
The document discusses the end of increasing processor clock speeds and the rise of multi-core processors, necessitating concurrent programming. It covers challenges with locks and conditions variables for concurrency including composition issues. Software transactional memory (STM) is presented as an alternative that allows for composable concurrent operations through atomic blocks and transactional variables. While STM avoids issues like deadlocks, side effects and performance under high contention are concerns.
This document provides an overview and agenda for a presentation on polyglot programming and asynchronous programming using C++ features like futures, coroutines, and generators. The presentation introduces DDS-RPC, which allows for remote procedure calls over a data distribution service middleware. It discusses how C++ futures and coroutines can be used to write asynchronous and non-blocking I/O code in a synchronous-looking way. Examples are provided to demonstrate features like serial and parallel composition of futures, using await with coroutines, and using generators to lazily iterate over data.
PVS-Studio is a tool for detecting bugs and security weaknesses in the source code of programs, written in C, C++, C# and Java. It works under 64-bit systems in Windows, Linux and macOS environments, and can analyze source code intended for 32-bit, 64-bit and embedded ARM platforms.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces basic concepts about the Java Remote Method Invocation, a.k.a. RMI. These slides introduce the following concepts:
- Remote interfaces
- Dynamic code loading
- Serialization
- Security manager
- Exporting remote objects
- Compiling and running RMI programs
- Distributed garbage collection
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The document discusses aspect mining, which aims to identify cross-cutting concerns in legacy code. It presents the History-based Aspect Mining (HAM) approach, which analyzes code change history transactions to identify cross-cutting patterns. HAM was applied to the Eclipse project, identifying over 1,000 aspect candidates by finding methods called from multiple locations. Future work is discussed around refactoring concerns over time and understanding relationships between cross-cutting concerns.
Natural Task Scheduling Using Futures and Continuations, Ivan Čukić, Qt Devel...Ivan Čukić
We are used to think about algorithms in a procedural manner – with loops, branches and subroutines. Presenting an algorithm as an easily understandable flow between its steps.
In the real world, where we need to reduce latency and forbid the blocking API calls, these flows get broken. Due to the inversion of control (IoC) required by the introduction of asynchronous APIs (Xlib vs. XCB, iostream vs. boost::asio), the code becomes an unreadable call-callback soup.
We are presenting a way of defining the algorithm flow in a procedural manner and leaving it up to the C++ compiler to generate the necessary asynchronous code.
Доклад вводит в рассмотрение универсальный адаптер, позволяющий обернуть любой класс с целью добавления новых свойств, отсутствующих в оригинальном классе. Получаемые классы могут иметь в точности такой же интерфейс, как и первоначальные, что позволяет прозрачно заменять их и оборачивать любое количество раз.
Это позволяет добавлять необходимые свойства объектам, не переписывая его с нуля. Предложенная обобщенная концепция будет последовательно введена и проиллюстрирована простыми, но интересными примерами.
The document analyzes potential issues found by PVS-Studio in various KDE projects and libraries. It identifies several types of issues, including expressions that are always true or false, unsafe pointer usage before validation, missing keywords that could alter program logic, and unsafe realloc() usage. A total of 27 specific code fragments are highlighted across the different libraries and applications as demonstrating these kinds of issues.
This presentation introduces the Java concept of thread. It is the first part of a series of slides dedicated to concurrent programming. This slides introduces some basics concepts, such as:
- Differences between processes and threads
- Thread's basics
- Thread's states
- Introduction to UML sequence diagrams
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The new Actor representation in Akka Typed allows formulations that lend themselves to monadic interpretation or introspection. This leads us to explore possibilities for expressing and verifying dynamic properties like the adherence to a communication protocol between multiple agents as well as the safety properties of that protocol on a global level. Academic research in this area is far from complete, but there are interesting initial results that we explore in this session: precisely how much purity and reasoning can we bring to the distributed world?
Threads, Events, Signals/Slots provides an overview of multithreaded programming in QT including:
1) QT supports threading through the QThread class and provides thread safe APIs like QMutex. GUI operations are only allowed on the main thread.
2) QT uses an event-based model where events are processed in an event loop. Events can be used for intra-thread and inter-thread communication.
3) Signals and slots provide a type-safe mechanism for loose coupling between objects and allow one-to-many and many-to-one communication. They are mapped to events and processed in the receiving object's thread.
This document provides an overview of the FreeRTOS real-time operating system. It discusses FreeRTOS's task management features including task creation, states, data structures, and blocking behavior. It describes how tasks can create other tasks and pass parameters. It also summarizes FreeRTOS configuration options, licensing, and commercial variants.
Whats New in Visual Studio 2012 for C++ DevelopersRainer Stropek
For a Microsoft event we have been hired to do a full-day workshop about news in Visual Studio 2012 for C++ developers. My colleague Philipp Aumayr conducted the workshop. Here are the slides for his talk. More details including sample code can be found in our developer blog at http://www.software-architects.com
How to write multi threaded applications using Qt:
In the slides you'll learn about 3 alternatives, all of which allow running tasks simultaneously in Qt applications, and understand the use cases leading to choosing each.
L Fu - Dao: a novel programming language for bioinformaticsJan Aerts
The document introduces Dao, a new programming language for bioinformatics. It discusses Dao's key features like optional typing, native support for concurrent programming, an LLVM-based JIT compiler, simple C interfaces, and the ClangDao tool for wrapping C/C++ libraries. An example demonstrates using thread tasks and futures for concurrent programming. The document outlines future plans to develop BioDao, an open source project providing bioinformatics modules to the Dao language.
Tesseract. Recognizing Errors in Recognition SoftwareAndrey Karpov
Tesseract is a free software program for text recognition developed by Google. According to the project description, "Tesseract is probably the most accurate open source OCR engine available". And what if we try to catch some bugs there with the help of the CppCat analyzer?
This document provides an overview of a tutorial on VHDL synthesis, place and route for FPGA and ASIC technologies. The tutorial covers VHDL coding styles, FPGA synthesis, place and route, a demo of FPGA synthesis and place and route, ASIC synthesis, place and route, and a demo of ASIC synthesis and place and route. The outline indicates it will also cover conclusions and further reading.
The document discusses various techniques for implementing reflection in object-oriented programming languages like Smalltalk. It describes approaches for controlling message passing through minimal objects, anonymous classes, and method substitution. Minimal objects intercept messages using doesNotUnderstand:, while anonymous classes are inserted between instances and their classes to control lookup. Method substitution directly replaces methods to add control. The document analyzes the tradeoffs of different reflective approaches.
The document discusses behavioral reflection and metaprogramming techniques in Smalltalk. It introduces sub-method structures like bytecode, the ByteSurgeon library for bytecode transformation, and Geppetto which enables partial behavioral reflection through hooksets and metaobjects. This allows profiling and caching to be selectively added to applications at runtime without restarting the system. Future work includes improving tool support and integrating with AST representations.
The document discusses the end of increasing processor clock speeds and the rise of multi-core processors, necessitating concurrent programming. It covers challenges with locks and conditions variables for concurrency including composition issues. Software transactional memory (STM) is presented as an alternative that allows for composable concurrent operations through atomic blocks and transactional variables. While STM avoids issues like deadlocks, side effects and performance under high contention are concerns.
This document provides an overview and agenda for a presentation on polyglot programming and asynchronous programming using C++ features like futures, coroutines, and generators. The presentation introduces DDS-RPC, which allows for remote procedure calls over a data distribution service middleware. It discusses how C++ futures and coroutines can be used to write asynchronous and non-blocking I/O code in a synchronous-looking way. Examples are provided to demonstrate features like serial and parallel composition of futures, using await with coroutines, and using generators to lazily iterate over data.
PVS-Studio is a tool for detecting bugs and security weaknesses in the source code of programs, written in C, C++, C# and Java. It works under 64-bit systems in Windows, Linux and macOS environments, and can analyze source code intended for 32-bit, 64-bit and embedded ARM platforms.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces basic concepts about the Java Remote Method Invocation, a.k.a. RMI. These slides introduce the following concepts:
- Remote interfaces
- Dynamic code loading
- Serialization
- Security manager
- Exporting remote objects
- Compiling and running RMI programs
- Distributed garbage collection
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The document discusses aspect mining, which aims to identify cross-cutting concerns in legacy code. It presents the History-based Aspect Mining (HAM) approach, which analyzes code change history transactions to identify cross-cutting patterns. HAM was applied to the Eclipse project, identifying over 1,000 aspect candidates by finding methods called from multiple locations. Future work is discussed around refactoring concerns over time and understanding relationships between cross-cutting concerns.
Natural Task Scheduling Using Futures and Continuations, Ivan Čukić, Qt Devel...Ivan Čukić
We are used to think about algorithms in a procedural manner – with loops, branches and subroutines. Presenting an algorithm as an easily understandable flow between its steps.
In the real world, where we need to reduce latency and forbid the blocking API calls, these flows get broken. Due to the inversion of control (IoC) required by the introduction of asynchronous APIs (Xlib vs. XCB, iostream vs. boost::asio), the code becomes an unreadable call-callback soup.
We are presenting a way of defining the algorithm flow in a procedural manner and leaving it up to the C++ compiler to generate the necessary asynchronous code.
Доклад вводит в рассмотрение универсальный адаптер, позволяющий обернуть любой класс с целью добавления новых свойств, отсутствующих в оригинальном классе. Получаемые классы могут иметь в точности такой же интерфейс, как и первоначальные, что позволяет прозрачно заменять их и оборачивать любое количество раз.
Это позволяет добавлять необходимые свойства объектам, не переписывая его с нуля. Предложенная обобщенная концепция будет последовательно введена и проиллюстрирована простыми, но интересными примерами.
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионаловSergey Platonov
В докладе перед нами откроется великолепный мир велосипедов и устаревших технологий, которые люди продолжают переносить в новые проекты и повсеместно использовать. Мы поговорим о:
Copy-On-Write
разработке без оглядки на готовые решения и к чему это приводит
force inline
оптимизациях, которые отлично себя показывают на бенчмарках и плохо себя ведут в реальной жизни
бездумно отключаемых оптимизациях компилятора
тонкостях стандартной библиотеки для повседневного использования
супер качественном велосипедостроении
Догнать и перегнать boost::lexical_castRoman Orlov
Разбор нестандартной реализации преобразования целого числа в строку без использования циклов и рекурсивных вызовов времени исполнения - только рекурсия на этапе компиляции
В своих прошлых докладах (http://cpp-russia.ru/?p=198, и http://cpp-russia.ru/?page_id=1239) я рассказывал о C++ без исключений, как с эти жить, как работать. Этот доклад является продолжением этой серии. Я рекомендую освежить в памяти предыдущие доклады, чтобы наша работа была более продуктивной. Мы обсудим механизмы создания, копирования и перемещения объектов, механизмы аллокации и деаллокации памяти, а также обработку ошибок и исключений. Также мы обсудим проблемы и неудобства, которые испытывает программист, когда пишет код без исключений. В конце, я попытаюсь показать, как можно проектировать структуры данных, контейнеры для удобной работы в средах с исключениями и без исключений.
Фитнес для вашего кода: как держать его в формеIlia Shishkov
C++ Россия 2017
Во время моего выступления мы поговорим о принципе "Minimize coupling, maximize cohesion". Обсудим, что это такое и что значат эти непонятные слова. Кроме того на приближенном к реальности примере мы рассмотрим, как, применяя указанный принцип, можно держать ваш код в форме, чтобы он был готов ко всем неожиданностям, которые подстерегают ваш проект в течение его жизни.
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itSergey Platonov
The talk will look at limitations of compilers when creating fast code and how to make more effective use of both the underlying micro-architecture of modern CPU's and how algorithmic optimizations may have surprising effects on the generated code. We shall discuss several specific CPU architecture features and their pros and cons in relation to creating fast C++ code. We then expand with several algorithmic techniques, not usually well-documented, for making faster, compiler friendly, C++.
Note that we shall not discuss caching and related issues here as they are well documented elsewhere.
Tecnologie didattiche.
Terza versione delle slide a supporto del corso per i docenti neo immessi in ruolo nel corrente anno scolastico della provincia di Torino.
Le tecnologie proposte non sono “la soluzione”, ma solo un punto di partenza dettato dalla mia esperienza e di quella dei tantissimi colleghi che ho incontrato nel mio cammino.
E’ uno starter kit e come tale deve essere inteso è da espandere e modificare secondo le necessità.
Ponendosi nelle condizioni del docente che non ha nessuna competenza tecnologica, nelle tre ore di corso l'obiettivo principale sarà quello di incominciare a conoscere gli strumenti di base per rendere più efficace il proprio lavoro ed essere in grado da solo di costruire un proprio Personal Learning Network che sfrutterà a sua volta per apprendere anche le tecnologie.
Dall'organizzazione del proprio lavoro all'uso di strumenti software.
Il corso, prevede anche una parte da svolgere on-line utilizzando Edmodo.
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)Rick Hightower
see labs at https://github.com/advantageous/j1-talks-2016
Import based on PPT so there is more notes. This is from our JavaOne Talk 2016 on Reakt, reactive Java programming with promises, circuit breakers, and streams. Reakt is a reactive Java lib that provides promises, streams, and a reactor to handle asynchronous call coordination. It was influenced by the design of promises in ES6. You want to async-call serviceA and then serviceB, take the results of serviceA and serviceB, and then call serviceC. Then, based on the results of call C, call D or E and then return the results to the original caller. Calls to A, B, C, D, and E are all async calls, and none should take longer than 10 seconds. If they do, then return a timeout to the original caller. The whole async call sequence should time out in 20 seconds if it does not complete and should also check for circuit breakers and provide back pressure feedback so the system does not have cascading failures. Learn more in this session.
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)Rick Hightower
see labs at https://github.com/advantageous/j1-talks-2016
Import based on PDF. This is from our JavaOne Talk 2016 on Reakt, reactive Java programming with promises, circuit breakers, and streams. Reakt is a reactive Java lib that provides promises, streams, and a reactor to handle asynchronous call coordination. It was influenced by the design of promises in ES6. You want to async-call serviceA and then serviceB, take the results of serviceA and serviceB, and then call serviceC. Then, based on the results of call C, call D or E and then return the results to the original caller. Calls to A, B, C, D, and E are all async calls, and none should take longer than 10 seconds. If they do, then return a timeout to the original caller. The whole async call sequence should time out in 20 seconds if it does not complete and should also check for circuit breakers and provide back pressure feedback so the system does not have cascading failures. Learn more in this session.
Fuel Up JavaScript with Functional ProgrammingShine Xavier
JavaScript is the lingua franca of web development for over a decade. It has evolved tremendously along with the Web and has entrenched in modern browsers, complex Web applications, mobile development, server-side programming, and in emerging platforms like the Internet of Things.
Eventhough JavaScript has come a long way, a reinforced makeover to it will help build concurrent and massive systems that handle Big Data, IoT peripherals and many other complex eco systems. Functional Programming is the programming paradigm that could empower JavaScript to to enable more effective, robust, and flexible software development.
These days, Functional Programming is at the heart of every new generation programming technologies. The inclusion of Functional Programming in JavaScript will lead to advanced and futuristic systems.
The need of the hour is to unwrap the underlying concepts and its implementation in the software development process.
The 46th edition of FAYA:80 provides a unique opportunity for the JavaScript developers and technology enthusiasts to shed light on the functional programming paradigm and on writing efficient functional code in JavaScript.
Join us for the session to know more.
Topics Covered:
· Functional Programming Core Concepts
· Function Compositions & Pipelines
· Use of JS in Functional Programming
· Techniques for Functional Coding in JS
· Live Demo
Some key features of Scala include:
1. It allows blending of functional programming and object-oriented programming for more concise and powerful code.
2. The static type system allows for type safety while maintaining expressiveness through type inference, implicits, and other features.
3. Scala code interoperates seamlessly with existing Java code and libraries due to its compatibility with the JVM.
20160609 nike techtalks reactive applications tools of the tradeshinolajla
An update to my talk about concurrency abstractions, including event loops (node.js and Vert.x), CSP (Go, Clojure), Futures, CPS/Dataflow (RxJava) and Actors (Erlang, Akka)
Non-blocking synchronization — what is it and why we (don't?) need itAlexey Fyodorov
This document contains notes from a presentation on non-blocking synchronization. It introduces concepts like concurrency, locking, compare-and-swap (CAS) operations, and how they are implemented in Java using classes like AtomicLong. CAS allows updating shared memory without locking, but can involve retries if the expected value changes. Java provides various atomic data structures like scalars, arrays, and accumulators that have lock-free or obstruction-free guarantees. Non-blocking data structures like lock-free stacks and queues are also discussed.
Compiler optimizations based on call-graph flatteningCAFxX
This document discusses compiler optimizations based on call-graph flattening. It proposes dismissing functions during early compilation and tracking control flow explicitly instead to remove overhead from function calls and enable powerful optimizations. A pilot implementation in LLVM showed code size improvements over existing inlining techniques when optimizations could handle the flattened code, demonstrating the potential of the approach. Further work is needed to improve live value tracking, register allocation, and add support for indirect calls and recursion to fully leverage call-graph flattening.
Reactive programming has been touted as one of the most important new programming paradigms in recent history. The idea of designing software as asynchronous streams of data is compelling, as evidenced by the growing popularity of reactive programming and the frameworks based on it. In this session we’ll explore what it is, where it came from, and look at its implementation in the Reactive Extensions API.
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Chris Adamson
The document provides an overview of the C programming language. It begins by explaining that Objective-C extends standard ANSI C with object-oriented capabilities. It then discusses why C remains important today due to its use in libraries, operating systems, and as the base for many other popular languages. The document proceeds to cover basic C concepts like variables, data types, functions, flow control, pointers, memory allocation, and I/O parameters. It emphasizes that C provides high performance with a minimal footprint while abstracting away the CPU and memory.
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)PROIDEA
Kiedy ostatnio stworzyłeś nową strukturę pisząc aplikację w .NET? Wiesz do czego wykorzystywać struktury i jak mogą one zwiększyć wydajność Twojego programu? W prezentacji pokażę czym charakteryzują się struktury, jak dużo różni je od klas oraz opowiem o kilku ciekawych eksperymentach.
Reactive Programming, Traits and Principles. What is Reactive, where does it come from, and what is it good for? How does it differ from event driven programming? It only functional?
Building High-Performance Language Implementations With Low EffortStefan Marr
This talk shows how languages can be implemented as self-optimizing interpreters, and how Truffle or RPython go about to just-in-time compile these interpreters to efficient native code.
Programming languages are never perfect, so people start building domain-specific languages to be able to solve their problems more easily. However, custom languages are often slow, or take enormous amounts of effort to be made fast by building custom compilers or virtual machines.
With the notion of self-optimizing interpreters, researchers proposed a way to implement languages easily and generate a JIT compiler from a simple interpreter. We explore the idea and experiment with it on top of RPython (of PyPy fame) with its meta-tracing JIT compiler, as well as Truffle, the JVM framework of Oracle Labs for self-optimizing interpreters.
In this talk, we show how a simple interpreter can reach the same order of magnitude of performance as the highly optimizing JVM for Java. We discuss the implementation on top of RPython as well as on top of Java with Truffle so that you can start right away, independent of whether you prefer the Python or JVM ecosystem.
While our own experiments focus on SOM, a little Smalltalk variant to keep things simple, other people have used this approach to improve peek performance of JRuby, or build languages such as JavaScript, R, and Python 3.
ScalaDays 2013 Keynote Speech by Martin OderskyTypesafe
Scala gives you awesome expressive power, but how to make best use of it? In my talk I will discuss the question what makes good Scala style. We will start with syntax and continue with how to name things, how to mix objects and functions, where (and where not) to use mutable state, and when to use which design pattern. As most questions of style, the discussion will be quite subjective, and some of it might be controversial. I am looking forward to discuss these topics with the conference attendees.
- Scala is being adopted for web platforms, trading platforms, financial modeling, and simulation. Scala 2.9 includes improvements to parallel and concurrent computing libraries as well as faster compilation.
- Play Framework 2.0 will move to a Scala core while retaining Java support. The Scala Eclipse IDE has been reworked for better reliability and responsiveness.
- Scala 2.10 will include a new reflection framework and other IDE improvements. Avoiding mutable state enables functional and parallel programming. Scala supports both parallelism and concurrency through tools like parallel collections and actors.
- Future work includes distributed collections, parallel domain-specific languages, and unifying the Scala compiler and reflection APIs. Scal
Qt Everywhere is a C++ abstraction platform that provides a complete portability layer for C++ applications across Windows, Linux, and Mac operating systems through frameworks like QtCore, QtNetwork, and QtXml that standardize APIs for file systems, networking, threading, and other common needs; while the standard C++ library is limited, Qt offers mature classes that make everyday C++ programming tasks easy and portable.
This document provides an introduction to RxJS, a library for reactive programming using streams. It discusses how RxJS solves problems with asynchronous code using callbacks by introducing the concept of observable streams. Streams can represent dynamic data sources and allow declarative specification of computations on stream values. The key components in RxJS are Observables, which wrap data sources, and Observers, which consume observable streams and react to emitted events. Common ways of creating observables from sources like arrays or events are demonstrated.
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the UglyHaim Yadid
NEXT Insurance is a US based insurtech startup, revolutionizing the small business insurance industry. NEXT was founded 6 years ago and ever since we have been building our microservices in Kotlin. During this period we grew from a small startup with one backend developer(myself) to a $4B company with 150 backend developers. We have written over 1.2M lines of code in Kotlin and aquired long mileage with this programming language. In this talk I am going to share our experiences, insights and pains.
This talk was given in JFokus 2022
This document provides an overview and summary of new features in Java 8. It begins with the schedule and release dates for Java 8 from 2012 to 2014. The major changes covered include lambda expressions, which allow passing code as data and are enabled by default functional interfaces. The new date/time API provides a modern replacement for the legacy Date/Calendar APIs. Type annotations allow adding metadata to types. Compact profiles define modular class libraries. Overall, Java 8 aims to better support parallel programming through new language features and library APIs.
Similar to Reactive Qt - Ivan Čukić (Qt World Summit 2015) (20)
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid
IBM watsonx Code Assistant for Z, our latest Generative AI-assisted mainframe application modernization solution. Mainframe (IBM Z) application modernization is a topic that every mainframe client is addressing to various degrees today, driven largely from digital transformation. With generative AI comes the opportunity to reimagine the mainframe application modernization experience. Infusing generative AI will enable speed and trust, help de-risk, and lower total costs associated with heavy-lifting application modernization initiatives. This document provides an overview of the IBM watsonx Code Assistant for Z which uses the power of generative AI to make it easier for developers to selectively modernize COBOL business services while maintaining mainframe qualities of service.
Odoo releases a new update every year. The latest version, Odoo 17, came out in October 2023. It brought many improvements to the user interface and user experience, along with new features in modules like accounting, marketing, manufacturing, websites, and more.
The Odoo 17 update has been a hot topic among startups, mid-sized businesses, large enterprises, and Odoo developers aiming to grow their businesses. Since it is now already the first quarter of 2024, you must have a clear idea of what Odoo 17 entails and what it can offer your business if you are still not aware of it.
This blog covers the features and functionalities. Explore the entire blog and get in touch with expert Odoo ERP consultants to leverage Odoo 17 and its features for your business too.
An Overview of Odoo ERP
Odoo ERP was first released as OpenERP software in February 2005. It is a suite of business applications used for ERP, CRM, eCommerce, websites, and project management. Ten years ago, the Odoo Enterprise edition was launched to help fund the Odoo Community version.
When you compare Odoo Community and Enterprise, the Enterprise edition offers exclusive features like mobile app access, Odoo Studio customisation, Odoo hosting, and unlimited functional support.
Today, Odoo is a well-known name used by companies of all sizes across various industries, including manufacturing, retail, accounting, marketing, healthcare, IT consulting, and R&D.
The latest version, Odoo 17, has been available since October 2023. Key highlights of this update include:
Enhanced user experience with improvements to the command bar, faster backend page loading, and multiple dashboard views.
Instant report generation, credit limit alerts for sales and invoices, separate OCR settings for invoice creation, and an auto-complete feature for forms in the accounting module.
Improved image handling and global attribute changes for mailing lists in email marketing.
A default auto-signature option and a refuse-to-sign option in HR modules.
Options to divide and merge manufacturing orders, track the status of manufacturing orders, and more in the MRP module.
Dark mode in Odoo 17.
Now that the Odoo 17 announcement is official, let’s look at what’s new in Odoo 17!
What is Odoo ERP 17?
Odoo 17 is the latest version of one of the world’s leading open-source enterprise ERPs. This version has come up with significant improvements explained here in this blog. Also, this new version aims to introduce features that enhance time-saving, efficiency, and productivity for users across various organisations.
Odoo 17, released at the Odoo Experience 2023, brought notable improvements to the user interface and added new functionalities with enhancements in performance, accessibility, data analysis, and management, further expanding its reach in the market.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Paul Brebner
Closing talk for the Performance Engineering track at Community Over Code EU (Bratislava, Slovakia, June 5 2024) https://eu.communityovercode.org/sessions/2024/why-apache-kafka-clusters-are-like-galaxies-and-other-cosmic-kafka-quandaries-explored/ Instaclustr (now part of NetApp) manages 100s of Apache Kafka clusters of many different sizes, for a variety of use cases and customers. For the last 7 years I’ve been focused outwardly on exploring Kafka application development challenges, but recently I decided to look inward and see what I could discover about the performance, scalability and resource characteristics of the Kafka clusters themselves. Using a suite of Performance Engineering techniques, I will reveal some surprising discoveries about cosmic Kafka mysteries in our data centres, related to: cluster sizes and distribution (using Zipf’s Law), horizontal vs. vertical scalability, and predicting Kafka performance using metrics, modelling and regression techniques. These insights are relevant to Kafka developers and operators.
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...kalichargn70th171
In today's fiercely competitive mobile app market, the role of the QA team is pivotal for continuous improvement and sustained success. Effective testing strategies are essential to navigate the challenges confidently and precisely. Ensuring the perfection of mobile apps before they reach end-users requires thoughtful decisions in the testing plan.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
Project Management: The Role of Project Dashboards.pdfKarya Keeper
Project management is a crucial aspect of any organization, ensuring that projects are completed efficiently and effectively. One of the key tools used in project management is the project dashboard, which provides a comprehensive view of project progress and performance. In this article, we will explore the role of project dashboards in project management, highlighting their key features and benefits.
The Rising Future of CPaaS in the Middle East 2024Yara Milbes
Explore "The Rising Future of CPaaS in the Middle East in 2024" with this comprehensive PPT presentation. Discover how Communication Platforms as a Service (CPaaS) is transforming communication across various sectors in the Middle East.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
Preparing Non - Technical Founders for Engaging a Tech AgencyISH Technologies
Preparing non-technical founders before engaging a tech agency is crucial for the success of their projects. It starts with clearly defining their vision and goals, conducting thorough market research, and gaining a basic understanding of relevant technologies. Setting realistic expectations and preparing a detailed project brief are essential steps. Founders should select a tech agency with a proven track record and establish clear communication channels. Additionally, addressing legal and contractual considerations and planning for post-launch support are vital to ensure a smooth and successful collaboration. This preparation empowers non-technical founders to effectively communicate their needs and work seamlessly with their chosen tech agency.Visit our site to get more details about this. Contact us today www.ishtechnologies.com.au
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESanfaltahir1010
Image: Include an image that represents the concept of precision, such as a AI helix or a futuristic healthcare
setting.
Objective: Provide a foundational understanding of precision medicine and its departure from traditional
approaches
Role of theory: Discuss how genomics, the study of an organism's complete set of AI ,
plays a crucial role in precision medicine.
Customizing treatment plans: Highlight how genetic information is used to customize
treatment plans based on an individual's genetic makeup.
Examples: Provide real-world examples of successful application of AI such as genetic
therapies or targeted treatments.
Importance of molecular diagnostics: Explain the role of molecular diagnostics in identifying
molecular and genetic markers associated with diseases.
Biomarker testing: Showcase how biomarker testing aids in creating personalized treatment plans.
Content:
• Ethical issues: Examine ethical concerns related to precision medicine, such as privacy, consent, and
potential misuse of genetic information.
• Regulations and guidelines: Present examples of ethical guidelines and regulations in place to safeguard
patient rights.
• Visuals: Include images or icons representing ethical considerations.
Content:
• Ethical issues: Examine ethical concerns related to precision medicine, such as privacy, consent, and
potential misuse of genetic information.
• Regulations and guidelines: Present examples of ethical guidelines and regulations in place to safeguard
patient rights.
• Visuals: Include images or icons representing ethical considerations.
Content:
• Ethical issues: Examine ethical concerns related to precision medicine, such as privacy, consent, and
potential misuse of genetic information.
• Regulations and guidelines: Present examples of ethical guidelines and regulations in place to safeguard
patient rights.
• Visuals: Include images or icons representing ethical considerations.
Real-world case study: Present a detailed case study showcasing the success of precision
medicine in a specific medical scenario.
Patient's journey: Discuss the patient's journey, treatment plan, and outcomes.
Impact: Emphasize the transformative effect of precision medicine on the individual's
health.
Objective: Ground the presentation in a real-world example, highlighting the practical
application and success of precision medicine.
Data challenges: Address the challenges associated with managing large sets of patient data in precision
medicine.
Technological solutions: Discuss technological innovations and solutions for handling and analyzing vast
datasets.
Visuals: Include graphics representing data management challenges and technological solutions.
Objective: Acknowledge the data-related challenges in precision medicine and highlight innovative solutions.
Data challenges: Address the challenges associated with managing large sets of patient data in precision
medicine.
Technological solutions: Discuss technological innovations and solutions
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
1. Reactive programming and Qt
Qt World Summit, Berlin 2015
Ivan ˇCuki´c
ivan.cukic@kde.org
http://cukic.co
2. Reactive Continuations Ranges Streams Epilogue
About me
KDE development
Talks and teaching
Functional programming enthusiast, but not a purist
2
3. Reactive Continuations Ranges Streams Epilogue
Disclaimer
Make your code readable. Pretend the next person
who looks at your code is a psychopath and they know
where you live.
Philip Wadler
3
4. Reactive Continuations Ranges Streams Epilogue
Disclaimer
The code snippets are optimized for presentation, it is not
production-ready code.
std namespace is omitted, value arguments used instead of const-refs or
forwarding refs, etc.
4
6. Reactive Continuations Ranges Streams Epilogue
What is reactive?
We believe that a coherent approach to systems
architecture is needed, and we believe that all
necessary aspects are already recognised individually:
we want systems that are Responsive, Resilient, Elastic
and Message Driven. We call these Reactive Systems.
Systems built as Reactive Systems are more flexible,
loosely-coupled and scalable. This makes them easier
to develop and amenable to change. They are
significantly more tolerant of failure and when failure
does occur they meet it with elegance rather than
disaster. Reactive Systems are highly responsive, giving
users effective interactive feedback.
Reactive Manifesto 2.0
6
8. Reactive Continuations Ranges Streams Epilogue
What is reactive?
Showing a response to a stimulus
Oxford Dictionary
8
9. Reactive Continuations Ranges Streams Epilogue
What is reactive?
C: event call-backs
Java: event listeners
C++/Qt: signals and slots
even IO streams?
9
10. Reactive Continuations Ranges Streams Epilogue
What is reactive?
No shared state
Separate isolated components
Communication only through message passing
10
18. Reactive Continuations Ranges Streams Epilogue
Concurrency
Interactive systems
Threads
Multiple processes
Distributed systems
Note: "concurrency" will mean that different tasks are executed at
overlapping times.
18
19. Reactive Continuations Ranges Streams Epilogue
Plain threads are bad
A large fraction of the flaws in software development
are due to programmers not fully understanding all the
possible states their code may execute in. In a
multithreaded environment, the lack of understanding
and the resulting problems are greatly amplified,
almost to the point of panic if you are paying attention.
John Carmack
In-depth: Functional programming in C++
19
20. Reactive Continuations Ranges Streams Epilogue
Plain threads are bad
Threads are not composable
Parallelism can’t be ‘disabled’
Difficult to ensure balanced load manually
Hartmut Kaiser
Plain Threads are the GOTO of Today’s Computing
Meeting C++ 2014
20
21. Reactive Continuations Ranges Streams Epilogue
Plain synchronization primitives are bad
You will likely get it wrong
S.L.O.W. (starvation, latency, overhead, wait)
Sean Parent
Better Code: Concurrency
C++ Russia, 2015
21
23. Reactive Continuations Ranges Streams Epilogue
Locks are the main problem
The biggest of all the big problems with recursive mutexes is that
they encourage you to completely lose track of your locking scheme
and scope. This is deadly. Evil. It’s the "thread eater". You hold locks
for the absolutely shortest possible time. Period. Always. If you’re
calling something with a lock held simply because you don’t know it’s
held, or because you don’t know whether the callee needs the mutex,
then you’re holding it too long. You’re aiming a shotgun at your
application and pulling the trigger. You presumably started using
threads to get concurrency; but you’ve just PREVENTED concurrency.
I’ve often joked that instead of picking up Djikstra’s cute
acronym we should have called the basic synchronization
object "the bottleneck". Bottlenecks are useful at times,
sometimes indispensible – but they’re never GOOD.
David Butenhof
Re: recursive mutexes
23
24. Reactive Continuations Ranges Streams Epilogue
Futures
Futures should be the lowest level concurrency abstractions.
std::future
boost::future
QFuture
Folly Future
any continuation - *.then([] . . . )
24
25. Reactive Continuations Ranges Streams Epilogue
Future
T value = function();
future<T> value = function(); . . . ; value.get();)
25
34. Reactive Continuations Ranges Streams Epilogue
Ranges in C++
return accumulate(
xs.cbegin(), xs.cend(),
1,
_1 * _2
);
34
35. Reactive Continuations Ranges Streams Epilogue
Ranges in C++
How to do an aggregation on a transformed list?
vector<int> xs;
int sum = 0;
for (x: xs) {
sum += x * x;
}
return sum;
35
36. Reactive Continuations Ranges Streams Epilogue
Ranges in C++
How to do an aggregation on a transformed list?
sum $ map (λ x → x * x) xs
36
37. Reactive Continuations Ranges Streams Epilogue
Ranges in C++
How to do an aggregation on a transformed list?
vector<int> temp;
std::transform(
xs.cbegin(), xs.cend(),
std::back_inserter(temp),
_1 * _1
);
return std::accumulate(
temp.cbegin(),
temp.cend()
);
37
38. Reactive Continuations Ranges Streams Epilogue
Ranges in C++, boost.range, N4128
How to do an aggregation on a transformed list?
return accumulate(xs | transformed(_1 * _1));
38
42. Reactive Continuations Ranges Streams Epilogue
Anything you think that you could ever be
for (item: items) {
// do something
}
for_each(items, [] (item i) {
// do something
});
42
46. Reactive Continuations Ranges Streams Epilogue
Through the eons, and on and on
Web server client connection requests
User interface events
Database access
I/O
Anything and everything
46
47. Reactive Continuations Ranges Streams Epilogue
Till the end of time
Message passing:
continuation!newClientMessage
Call-callback:
onNewMessage(continuation)
Signals-slots:
connect(socket, &Socket::newConnection,
receiver, &Receiver::continuation)
Any data collection:
for_each(xs, continuation)
47
48. Reactive Continuations Ranges Streams Epilogue
Stream transformation
Streams can only be transformed with algorithms that accept
input ranges, since we don’t have all the items. We don’t even
know when (if) they will end.
map, bind, filter, take, drop, etc.
48
50. Reactive Continuations Ranges Streams Epilogue
Map / Transform
We have a stream of 2D coordinates (mouse coordinates).
// Projecting on the x-axis
mouse_position >>=
map(λ point → (point.x, 0))
// Projecting on the y-axis
mouse_position >>=
map(λ point → (0, point.y))
50
59. Reactive Continuations Ranges Streams Epilogue
Flat map
class more_precision {
public:
more_precision() { }
template <typename Cont>
void then(Cont &&c) { _f = std::forward<Cont>(c); }
std::vector<QPointF> operator() (const QPointF &new_point) {
std::vector<QPointF> result;
int stepX = (m_previous_point.x() < new_point.x()) ? 1 : -1;
for (int i = (int)m_previous_point.x(); i != (int)new_point.x(); i += stepX) {
result.emplace_back(i, m_previous_point.y());
}
int stepY = (m_previous_point.y() < new_point.y()) ? 1 : -1;
for (int i = (int)m_previous_point.y(); i != (int)new_point.y(); i += stepY) {
result.emplace_back(new_point.x(), i);
}
m_previous_point = new_point;
return result;
}
private:
std::function<void(QPointF)> _f;
QPointF m_previous_point;
};
59
60. Reactive Continuations Ranges Streams Epilogue
Answers? Questions! Questions? Answers!
Kudos:
Friends at KDE, Dr Saˇsa Malkov
Worth reading and watching:
Iterators Must Go, Andrei Alexandrescu
Value Semantics and Range Algorithms, Chandler Carruth
Systematic Error Handling in C++, Andrei Alexandrescu
Ranges proposal, Eric Niebler
Reactive manifesto, Books on Erlang or Scala/Akka
60