We face challenges with threading on a daily basis. There are too many ways to do it, too many options. Do I use an AsyncTaks, a Runnable or RxJava, what do I do? All these available APIs lead to an almost inevitable callback hell.
This talk will introduce Kotlin Coroutines as an alternative solution to this problem. We’re going to explore simple ways to perform long-running tasks and computation heavy operations in an asynchronous way, without freezing or crashing your app, while keeping the code clean and readable at the same time.
Kotlin coroutine - the next step for RxJava developer?Artur Latoszewski
Kotlin is a language that is rapidly gaining popularity, among others thanks to cooperation with Java. On the other hand, RxJava has brought us many solutions to problems related to asynchronous code. If everything is so cool, do we need anything else in the Kotlin world? Is Kotlin Coroutine a competition for RxJava?
In this presentation, I'm talking about a powerful tool for asynchronous loading which is provided by Android framework - loaders. Why guys from Android team added this tool and how we can customise it? We'll try to find answers for these questions.
The document discusses Android Loaders, which provide a way for Activities and Fragments to asynchronously load data from a data source and deliver it back without having to manage threads or handle configuration changes. Loaders allow data to persist across configuration changes like orientation changes. The document covers the history of loading data in Android including threads and AsyncTask, introduces Loaders and the LoaderManager API, discusses implementing basic Loaders including CursorLoaders, and covers common mistakes to avoid.
The document discusses Loaders and Adapters in Android. It begins with an introduction to Loaders, explaining that they allow loading data asynchronously while coordinating with the Activity lifecycle. It covers how Loaders work, including the Loader, LoaderCallbacks and LoaderManager classes. It then provides an example of creating a simple Loader. The document next discusses preparing an Activity to use a Loader. It moves on to discussing the CursorLoader for querying ContentProviders. The second part of the document covers Adapters, their role in bridging data and views. It mentions common Adapter implementations like ArrayAdapter and CursorAdapter.
QVariant, QObject — Qt's not just for GUI developmentICS
This document summarizes a webinar on Qt's object model. It discusses how Qt's classes can be divided into identity types like QObject that derive from C++ and extend it with features using a meta-object system, and value types like QVariant that use copy-on-write. It covers how QObject is the heart of Qt's object model and includes features like memory management, object properties, introspection, signals and slots, and event handling. It also discusses QVariant's role as a union for common value types, and how to make custom classes use QVariants and properties.
A Brief Introduction to the Qt Application FrameworkZachary Blair
The document discusses the Qt framework for cross-platform GUI and application development. It introduces Qt's container classes like QList and QMap, string handling class QString, and widget and GUI programming using signals and slots. Qt provides a standard set of widgets that look native on different platforms. It uses a signal/slot system and parent-child relationships for memory management. Developers can write code once and deploy applications across desktop and embedded platforms.
This document is a 53 page presentation by Andreas Ecker of 1&1 Internet AG on advanced object-oriented JavaScript. It covers topics like classes, inheritance, scopes, closures, namespaces, and design patterns. It also introduces the qooxdoo framework, which provides features like classes, static members, interfaces, and mixins to improve the object model of JavaScript.
The JVM JIT compiler and deoptimizer are triggered under certain conditions like method invocation counts, changes in program behavior, and hot spots. The JIT initially compiles code to generate fast machine instructions while the deoptimizer reverts back to interpreted execution if needed.
Kotlin coroutine - the next step for RxJava developer?Artur Latoszewski
Kotlin is a language that is rapidly gaining popularity, among others thanks to cooperation with Java. On the other hand, RxJava has brought us many solutions to problems related to asynchronous code. If everything is so cool, do we need anything else in the Kotlin world? Is Kotlin Coroutine a competition for RxJava?
In this presentation, I'm talking about a powerful tool for asynchronous loading which is provided by Android framework - loaders. Why guys from Android team added this tool and how we can customise it? We'll try to find answers for these questions.
The document discusses Android Loaders, which provide a way for Activities and Fragments to asynchronously load data from a data source and deliver it back without having to manage threads or handle configuration changes. Loaders allow data to persist across configuration changes like orientation changes. The document covers the history of loading data in Android including threads and AsyncTask, introduces Loaders and the LoaderManager API, discusses implementing basic Loaders including CursorLoaders, and covers common mistakes to avoid.
The document discusses Loaders and Adapters in Android. It begins with an introduction to Loaders, explaining that they allow loading data asynchronously while coordinating with the Activity lifecycle. It covers how Loaders work, including the Loader, LoaderCallbacks and LoaderManager classes. It then provides an example of creating a simple Loader. The document next discusses preparing an Activity to use a Loader. It moves on to discussing the CursorLoader for querying ContentProviders. The second part of the document covers Adapters, their role in bridging data and views. It mentions common Adapter implementations like ArrayAdapter and CursorAdapter.
QVariant, QObject — Qt's not just for GUI developmentICS
This document summarizes a webinar on Qt's object model. It discusses how Qt's classes can be divided into identity types like QObject that derive from C++ and extend it with features using a meta-object system, and value types like QVariant that use copy-on-write. It covers how QObject is the heart of Qt's object model and includes features like memory management, object properties, introspection, signals and slots, and event handling. It also discusses QVariant's role as a union for common value types, and how to make custom classes use QVariants and properties.
A Brief Introduction to the Qt Application FrameworkZachary Blair
The document discusses the Qt framework for cross-platform GUI and application development. It introduces Qt's container classes like QList and QMap, string handling class QString, and widget and GUI programming using signals and slots. Qt provides a standard set of widgets that look native on different platforms. It uses a signal/slot system and parent-child relationships for memory management. Developers can write code once and deploy applications across desktop and embedded platforms.
This document is a 53 page presentation by Andreas Ecker of 1&1 Internet AG on advanced object-oriented JavaScript. It covers topics like classes, inheritance, scopes, closures, namespaces, and design patterns. It also introduces the qooxdoo framework, which provides features like classes, static members, interfaces, and mixins to improve the object model of JavaScript.
The JVM JIT compiler and deoptimizer are triggered under certain conditions like method invocation counts, changes in program behavior, and hot spots. The JIT initially compiles code to generate fast machine instructions while the deoptimizer reverts back to interpreted execution if needed.
Slides from a talk and live-coding session about Koin, a pragmatic and lightweight Dependency Injection framework for Kotlin. This talk was given at Auckland Android Community on Dec 5.
https://www.meetup.com/Android-Meetup/events/256734688/
So what to use when doing job outside main thread? Plain old Java thread? AsyncTask? Loader? Maybe something catchy, like RoboSpice or even rxAndroid?
Let’s dive deeply into nearly all possible ways of implementing async operations on Android. Find pros and cons, share our experience with all attitudes.
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.
Take a dive deep into the new prefab features with developers Steen Lund. What's the inside versus outside of a prefab? How does it relate to Prefab mode, overrides, unpacking, and prefab variants? How has the new prefab back-end changed? This session will give you a better understanding of the Prefab system, the pros and cons of various implementation decisions, and some Aha moments working with Prefab nesting.
This document discusses best practices in Qt Quick/QML. It covers the building blocks of QML like QObject and QQuickItem which inherit from QObject. It describes properties, signals, slots and introspection capabilities. Anchors provide a declarative way to lay out items by attaching them to parent and sibling items, improving performance over dead reckoning layouts. The document promotes using anchors and bindings over procedural JavaScript for layout where possible.
Object-Oriented Programming has well established design principles, such as SOLID. For many developers architecture and functional programming are at odds with each other: they don’t know how their existing tricks of the trade convert into functional design. This problem becomes worse as hybrid languages such as Scala, Java 8 and Ruby become common. I will talk about how functional programming helps you implement the SOLID principles, and how a functional mindset can actually help you achieve the holy grail of OO, encapsulation.
This document provides an overview of functional reactive programming (FRP) and compositional event systems (CES). It discusses how FRP approaches handling time-varying values like regular values. It presents an example of modeling game movements reactively using key press events. It also demonstrates how CES can be used to handle asynchronous workflows by turning network responses into observable streams. The document compares CES to other approaches like core.async and discusses benefits of CES like supporting multiple subscribers.
There is ongoing confusion, and some contention, over the right way to use the QThread class. Part of the confusion comes from the uniqueness of QThread, which is significantly different from other threading classes. There are two valid patterns of QThread use, and each pattern is best suited for different use cases. Errors will arise when mixing these two patterns, or applying them inappropriately.
This presentation will look at different patterns of threading in general, and examine in detail the two usage patterns for QThread. This talk will also cover how QThread works inside, how to communicate between threads, provide examples, and point out the pitfalls to avoid.
The document provides an introduction to core.async, a Clojure library for concurrency and communication using asynchronous channels. It discusses how core.async is based on Communicating Sequential Processes (CSP) and channels, and provides two examples of using core.async channels to coordinate concurrent processes. The first example shows coordinating three independent search services, and the second coordinates three processes running at different speeds. Both examples are demonstrated in ClojureScript using core.async channels.
This document introduces QML (Declarative UI) which allows describing user interface objects and properties in a declarative way and embedding JavaScript code. It discusses using QML to build user interfaces with animations and event handling. While QML is often used for mobile apps and small applications, it provides opportunities for designers to work more closely with developers. The document concludes by mentioning some features of QML and encouraging feedback on the ongoing Declarative UI project.
The document discusses object oriented JavaScript. It covers JavaScript types and constructors, creating custom types, using prototypes for inheritance and instance members. It also discusses namespaces, visibility, and polymorphism in JavaScript. Useful design patterns like factories, singletons, and modules are presented. The presentation provides examples and explanations of these core JavaScript concepts.
The document discusses Rx.js, a library for reactive programming using Observables. It begins by introducing Rx.js and some of its key benefits over other approaches to asynchronous programming like callbacks and Promises. It then provides examples of using Observables to represent asynchronous data streams and operations like DOM events. Key points made include that Observables allow for lazy execution, cancellation, composition of existing event streams, and treating asynchronous values as collections. The document concludes by demonstrating how Rx.js allows building a Morse code parser by modeling DOM events and signals as Observable streams.
This document summarizes a presentation on Qt Quick and QML. It covers QML concepts like properties, types, binding, and identities. It demonstrates a "Hello World" example in QML. It discusses topics like nested elements, graphical types, text items, anchors, and mouse input. The document contains code examples and screenshots to illustrate QML concepts.
Want a great introduction about prefabs in Unity 2018? Watch this intro session! Seasoned game developer and technical evangelist Ciro Continisio will explain all the major aspects of our new Prefab workflow (e.g., Nesting, Variants, Prefab Isolation Edit mode). He'll also tell you about the new UI/UX elements and the reasoning behind them.
This document discusses several popular Java libraries including:
- Dependency injection frameworks like Guice and Spring
- Logging with SLF4J
- Collections and utilities with Guava
- HTTP clients like OkHttp
- Reactive programming with RxJava
- REST with Retrofit
- Asynchronous programming with JDeferred
- Event handling with MBassador
- Code generation with Lombok and ByteBuddy
- Testing utilities like JUnitParams, Mockito, Jukito, and Spock
- Waiting assertions with Awaitility and REST testing with Rest-assured.
The document discusses virtual machines and JavaScript engines. It provides a brief history of virtual machines from the 1970s to today. It then explains how virtual machines work, including the key components of a parser, intermediate representation, interpreter, garbage collection, and optimization techniques. It discusses different approaches to interpretation like switch statements, direct threading, and inline threading. It also covers compiler optimizations and just-in-time compilation that further improve performance.
The document summarizes the current state of coroutines in Kotlin. Coroutines allow writing asynchronous, non-blocking code in a sequential style by suspending execution until operations complete. Key features include launch and async for starting coroutines, channels for communication, actors for message processing, and integration with frameworks like RxJava. Coroutines are ready for production use but still experimental to allow API changes in future versions.
Aplicações Assíncronas no Android com Coroutines e JetpackNelson Glauber Leal
Para usufruir dos múltiplos núcleos existentes nos processadores dos smartphones atuais, podemos realizar chamadas assíncronas de modo a paralelizar o fluxo de execução da aplicação. Normalmente isso é feito por meio de threads e callbacks que acabam por adicionar uma complexidade ao código que pode comprometer sua leitura e manutenção. Nessa apresentação, veremos como utilizar a API de Coroutines do Kotlin em conjunto com diversas bibliotecas do Jetpack do Android de modo a implementar programação assíncrona forma simples e eficiente.
Aplicações assíncronas no Android com Coroutines & JetpackNelson Glauber Leal
The document discusses asynchronous applications in Android using Coroutines & Jetpack. It introduces coroutines as lightweight threads that make asynchronous programming easier by replacing callbacks with suspending functions. It covers key coroutine concepts like Job, Context, Scope and Dispatcher. It also discusses how coroutines can be used with Lifecycle, ViewModel and WorkManager components in Jetpack to build asynchronous Android applications.
Slides from a talk and live-coding session about Koin, a pragmatic and lightweight Dependency Injection framework for Kotlin. This talk was given at Auckland Android Community on Dec 5.
https://www.meetup.com/Android-Meetup/events/256734688/
So what to use when doing job outside main thread? Plain old Java thread? AsyncTask? Loader? Maybe something catchy, like RoboSpice or even rxAndroid?
Let’s dive deeply into nearly all possible ways of implementing async operations on Android. Find pros and cons, share our experience with all attitudes.
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.
Take a dive deep into the new prefab features with developers Steen Lund. What's the inside versus outside of a prefab? How does it relate to Prefab mode, overrides, unpacking, and prefab variants? How has the new prefab back-end changed? This session will give you a better understanding of the Prefab system, the pros and cons of various implementation decisions, and some Aha moments working with Prefab nesting.
This document discusses best practices in Qt Quick/QML. It covers the building blocks of QML like QObject and QQuickItem which inherit from QObject. It describes properties, signals, slots and introspection capabilities. Anchors provide a declarative way to lay out items by attaching them to parent and sibling items, improving performance over dead reckoning layouts. The document promotes using anchors and bindings over procedural JavaScript for layout where possible.
Object-Oriented Programming has well established design principles, such as SOLID. For many developers architecture and functional programming are at odds with each other: they don’t know how their existing tricks of the trade convert into functional design. This problem becomes worse as hybrid languages such as Scala, Java 8 and Ruby become common. I will talk about how functional programming helps you implement the SOLID principles, and how a functional mindset can actually help you achieve the holy grail of OO, encapsulation.
This document provides an overview of functional reactive programming (FRP) and compositional event systems (CES). It discusses how FRP approaches handling time-varying values like regular values. It presents an example of modeling game movements reactively using key press events. It also demonstrates how CES can be used to handle asynchronous workflows by turning network responses into observable streams. The document compares CES to other approaches like core.async and discusses benefits of CES like supporting multiple subscribers.
There is ongoing confusion, and some contention, over the right way to use the QThread class. Part of the confusion comes from the uniqueness of QThread, which is significantly different from other threading classes. There are two valid patterns of QThread use, and each pattern is best suited for different use cases. Errors will arise when mixing these two patterns, or applying them inappropriately.
This presentation will look at different patterns of threading in general, and examine in detail the two usage patterns for QThread. This talk will also cover how QThread works inside, how to communicate between threads, provide examples, and point out the pitfalls to avoid.
The document provides an introduction to core.async, a Clojure library for concurrency and communication using asynchronous channels. It discusses how core.async is based on Communicating Sequential Processes (CSP) and channels, and provides two examples of using core.async channels to coordinate concurrent processes. The first example shows coordinating three independent search services, and the second coordinates three processes running at different speeds. Both examples are demonstrated in ClojureScript using core.async channels.
This document introduces QML (Declarative UI) which allows describing user interface objects and properties in a declarative way and embedding JavaScript code. It discusses using QML to build user interfaces with animations and event handling. While QML is often used for mobile apps and small applications, it provides opportunities for designers to work more closely with developers. The document concludes by mentioning some features of QML and encouraging feedback on the ongoing Declarative UI project.
The document discusses object oriented JavaScript. It covers JavaScript types and constructors, creating custom types, using prototypes for inheritance and instance members. It also discusses namespaces, visibility, and polymorphism in JavaScript. Useful design patterns like factories, singletons, and modules are presented. The presentation provides examples and explanations of these core JavaScript concepts.
The document discusses Rx.js, a library for reactive programming using Observables. It begins by introducing Rx.js and some of its key benefits over other approaches to asynchronous programming like callbacks and Promises. It then provides examples of using Observables to represent asynchronous data streams and operations like DOM events. Key points made include that Observables allow for lazy execution, cancellation, composition of existing event streams, and treating asynchronous values as collections. The document concludes by demonstrating how Rx.js allows building a Morse code parser by modeling DOM events and signals as Observable streams.
This document summarizes a presentation on Qt Quick and QML. It covers QML concepts like properties, types, binding, and identities. It demonstrates a "Hello World" example in QML. It discusses topics like nested elements, graphical types, text items, anchors, and mouse input. The document contains code examples and screenshots to illustrate QML concepts.
Want a great introduction about prefabs in Unity 2018? Watch this intro session! Seasoned game developer and technical evangelist Ciro Continisio will explain all the major aspects of our new Prefab workflow (e.g., Nesting, Variants, Prefab Isolation Edit mode). He'll also tell you about the new UI/UX elements and the reasoning behind them.
This document discusses several popular Java libraries including:
- Dependency injection frameworks like Guice and Spring
- Logging with SLF4J
- Collections and utilities with Guava
- HTTP clients like OkHttp
- Reactive programming with RxJava
- REST with Retrofit
- Asynchronous programming with JDeferred
- Event handling with MBassador
- Code generation with Lombok and ByteBuddy
- Testing utilities like JUnitParams, Mockito, Jukito, and Spock
- Waiting assertions with Awaitility and REST testing with Rest-assured.
The document discusses virtual machines and JavaScript engines. It provides a brief history of virtual machines from the 1970s to today. It then explains how virtual machines work, including the key components of a parser, intermediate representation, interpreter, garbage collection, and optimization techniques. It discusses different approaches to interpretation like switch statements, direct threading, and inline threading. It also covers compiler optimizations and just-in-time compilation that further improve performance.
The document summarizes the current state of coroutines in Kotlin. Coroutines allow writing asynchronous, non-blocking code in a sequential style by suspending execution until operations complete. Key features include launch and async for starting coroutines, channels for communication, actors for message processing, and integration with frameworks like RxJava. Coroutines are ready for production use but still experimental to allow API changes in future versions.
Aplicações Assíncronas no Android com Coroutines e JetpackNelson Glauber Leal
Para usufruir dos múltiplos núcleos existentes nos processadores dos smartphones atuais, podemos realizar chamadas assíncronas de modo a paralelizar o fluxo de execução da aplicação. Normalmente isso é feito por meio de threads e callbacks que acabam por adicionar uma complexidade ao código que pode comprometer sua leitura e manutenção. Nessa apresentação, veremos como utilizar a API de Coroutines do Kotlin em conjunto com diversas bibliotecas do Jetpack do Android de modo a implementar programação assíncrona forma simples e eficiente.
Aplicações assíncronas no Android com Coroutines & JetpackNelson Glauber Leal
The document discusses asynchronous applications in Android using Coroutines & Jetpack. It introduces coroutines as lightweight threads that make asynchronous programming easier by replacing callbacks with suspending functions. It covers key coroutine concepts like Job, Context, Scope and Dispatcher. It also discusses how coroutines can be used with Lifecycle, ViewModel and WorkManager components in Jetpack to build asynchronous Android applications.
The document provides code examples comparing Java and Kotlin implementations of common programming concepts and patterns. It shows how Kotlin simplifies concepts like listeners, constructors, properties, and null safety checks compared to Java.
This presentation shows tools and technologies used in Android Development such as Kotlin, Retrofit, and Room. It also shows different architectural patterns such as MVC, MVP, and MVVM
Aplicações assíncronas no Android com Coroutines & JetpackNelson Glauber Leal
Para usufruir dos múltiplos núcleos existentes nos processadores dos smartphones atuais, podemos realizar chamadas assíncronas de modo a paralelizar o fluxo de execução da aplicação. Normalmente isso é feito por meio de threads e callbacks que acabam por adicionar uma complexidade ao código que pode comprometer sua leitura e manutenção. Nessa apresentação, veremos como utilizar a API de Coroutines do Kotlin em conjunto com diversas bibliotecas do Jetpack do Android de modo a implementar programação assíncrona forma simples e eficiente.
What is a Coroutine in Kotlin? Which are the differences with threads? What is collaborative concurrency? Have a look at these slides and at the companion Github repository https://github.com/f-lombardo/kotlin-from-scratch
Practical tips for building apps with kotlinAdit Lal
This document provides an overview of Kotlin and best practices for building apps with Kotlin. Some key points:
- Kotlin is a statically typed language that runs on the JVM and is fully interoperable with Java. It adds features like null safety, lambdas, and concise syntax.
- Kotlin is perfect for Android development as it is compiled to Java bytecode and has full support for Android APIs. The migration process from Java to Kotlin is gradual.
- Best practices for Kotlin include using features like data classes, when expressions, higher order functions, and Android extensions to write more concise and readable code compared to Java.
Droidcon Berlin 2021 - With coroutines being the de facto way of exposing async work and streams of changes for Kotlin on Android, developers are obviously attempting to use the same approaches when moving their code to Multiplatform.
But due to the way the memory model differs between JVM and Kotlin Native, it can be a painful experience.
In this talk, we will take a deep dive into the Coroutine API for Kotlin Multiplatform. You will learn how to expose your API with Coroutines while working with the Kotlin Native memory model instead of against it, and avoid the dragons along the way.
The document discusses threading in Android applications. It begins by explaining that the main or UI thread is responsible for drawing the user interface and handling input/output events. Any blocking operations on this thread can cause the application to become unresponsive. The document then discusses various approaches for offloading work from the main thread including using AsyncTask, HandlerThread, IntentService, and ThreadPoolExecutor. It provides examples and best practices for implementing each approach to avoid blocking the main thread and ensure responsive user experiences.
Save time with kotlin in android developmentAdit Lal
Kotlin is a statically typed programming language that is fully interoperable with Java and improves on Java in several ways such as null safety, concise syntax, and functional programming features. The document provides an overview of Kotlin and how it can help improve Android development by reducing code verbosity and allowing for more concise implementations of common patterns compared to Java. It also provides guidance on incrementally migrating existing Java/Android projects to Kotlin.
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
This document provides examples of using coroutines in Kotlin for asynchronous programming. It shows how to launch coroutines concurrently using async, examples of suspending functions like delay to pause coroutine execution, and how to control coroutine dispatching using contexts like Dispatchers.Default to dispatch to thread pools. The examples demonstrate basic coroutine usage, integrating coroutines with Retrofit for asynchronous network calls, and how structured concurrency helps organize coroutine code.
COROUTINES CONSIDERED AS A REPLACEMENT FOR RXJAVA
Inspired by Droidcon Berlin discussion if "Rx should die?" I decided to replace RxJava with Kotlin Coroutines in my pet project.
As the result I've prepared short presentation. In the first part I focused on comparison between Retrofit2 kotlin coroutines adapter and RxJava adapter.
JavaFX 8 est disponible depuis mars 2014 et apporte son lot de nouveautés. Gradle est en version 2 depuis juillet 2014. Deux technologies plus que prometteuses: JavaFX donne un coup de jeune au développement d’applications desktop en Java en apportant un navigateur web intégré, le support des WebSockets, de la 3D, et bien d’autres. Gradle est l’outil de d’automatisation de build à la mode, apportant de superbes possibilités par rapport rapport à maven, outil vieillissant, grâce à l’engouement de la communauté vis à vis de cet outil mais aussi par le fait de la technologie utilisée en son sein: groovy. Venez découvrir comment il est possible de réaliser rapidement une application à la mode en JavaFX avec un outil à la mode également. Bref venez à une session trendy.
Kotlin for Android - Vali Iorgu - mRreadyMobileAcademy
Kotlin is a programming language that runs on the Java Virtual Machine and is fully interoperable with Java. It aims to combine object-oriented and functional programming features and to improve developer productivity. Some key features of Kotlin include null safety, extension functions, inline functions and lambdas, and support for coroutines. It provides painless Java interoperability so existing Java code and libraries can be used from Kotlin.
Unit testing without Robolectric, Droidcon Berlin 2016Danny Preussler
Are you bound to flaky, slow Robolectric Tests? Do you want to know a way out of it? This session shows ideas and concepts to replace Robolectric from your test code base
Ähnlich wie droidcon Transylvania - Kotlin Coroutines (20)
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
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
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/
2. Agenda
1. What are coroutines
2. Coroutines in Android
3. Why use coroutines
3. What are coroutines
“coroutines are computations that can be suspended
without blocking a thread.”
● Not a new concept, introduced in the `60s
● Adopted by multiple programming languages
● Coroutines in Kotlin:
○ minimal low-level APIs in its standard library
○ kotlinx.coroutines libraries
4. What are coroutines
● Terminology :
○ Coroutine
○ Suspending function
○ Coroutine builder
○ Continuation
○ Coroutine context
5. Coroutine
● An instance of suspendable computation
● Similar to a thread (light-weight thread)
● Also similar to a future or promise
6. Suspending functions
● Functions which suspend a coroutine execution
● suspend keyword
● Suspending functions can be used:
○ Inside other functions marked with the suspend keyword
○ Inside a coroutine
● suspendCoroutine
○ Bridge between coroutine suspension and callback world
7. Suspending functions
/**
* Obtains the current continuation instance
* inside suspend functions and suspends
* currently running coroutine.
*/
suspend inline fun <T> suspendCoroutine(
crossinline block: (Continuation<T>) -> Unit): T =
8. Suspending functions
public interface Continuation<in T> {
public val context: CoroutineContext
public fun resume(value: T)
public fun resumeWithException(exception: Throwable)
}
9. Suspending functions
suspend fun firstFun(): ResultType = suspendCoroutine { continuation ->
// do some heavy work
// resume the coroutine continuation with a result:
continuation.resume(result)
// or if there was an error:
continuation.resumeWithException(exception)
}
10. Coroutine builders
● Functions which start a coroutine
● Bridge between non-coroutine & coroutine world
● Most common coroutine builders:
○ launch
○ async
○ withContext
33. asyncOperation(object: Callback {
fun onSuccess(result) {
anotherOne(result, object: Callback {
fun onSuccess(secondResult){
lastOne(secondResult, object: Callback {
fun onSuccess(thirdResult){
useResult(thirdResult)
}
fun onError(exception){
handleError(exception)
}
})
}
fun onError(exception){
handleError(exception)
}
})
}
fun onError(exception) {
handleError(exception)
}
})
34. Why use coroutines
● Asynchronous code sequentially
● No more callback-hell
● “It’s experimental, we can’t use it!”
● “We already have so many options, why use this one?!”
35. Why use coroutines
val blurAsyncTask = object : AsyncTask<Uri, Int, Uri>() {
override fun doInBackground(vararg params: Uri?): Uri {
return blurImage(params)
}
override fun onPostExecute(result: Uri?) {
viewBinding.image.setImageURI(result)
viewModel.uploadImage(result)
}
}
blurAsyncTask.execute(imageUri)
36. Why use coroutines
private val executors = Executors.newCachedThreadPool()
fun uploadImage(imageUri: Uri) {
executors.execute {
val imageFile = File(imageUri.path)
val imageFilePart = createImagePart(imageFile)
restApiService.uploadBlurredImage(imageFilePart).enqueue(Callback<> {
override fun onResponse(response: Response<>) {
// use the response to update state, etc.
}
override fun onFailure(t: Throwable) {
}
})
}
}