This document discusses various topics related to how Kotlin code is compiled to bytecode, including:
- What Kotlin generates for primitives, strings, classes, null handling, extension functions, inline functions, and collection operations in bytecode
- How data classes are implemented and allow for destructuring
- Keypoints on lambda expressions and capturing variables
The document is a presentation that walks through Kotlin language features and demonstrates the resulting Java bytecode. It aims to provide insight into how Kotlin code is compiled under the hood.
The document contains 11 programs written in the Bash shell scripting language. Program 1 concatenates the contents of two files into a third file. Program 2 calculates the sum, average, and product of 4 input numbers. Program 3 swaps the values of two variables without using a third variable.
Kotlin is a statically-typed programming language for the JVM and the browser, built by a team at JetBrains and designed as a pragmatic and easy-to-use Java alternative. In this presentation we'll explore the most notable Kotlin features, such as:
- Extension functions
- Null-safety
- Smart casts
- and many more
Check out and see that programming in Kotlin is fun!
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
An updated version of my talk on virtual machine cores comparing techniques in C and Go for implementing dispatch loops, stacks & hash maps.
Lots of tested and debugged code is provided as well as references to some useful/interesting books.
- Typeclasses in Scala allow defining common behavior (like printing) for unrelated types through implicit parameters and resolution. This avoids needing to modify types to add functionality.
- They work by defining typeclass traits that take a type parameter (like Show[T]), providing implicit values that implement traits for specific types, and having methods use implicit parameters of the typeclass.
- While powerful, typeclasses can cause issues like ambiguous implicits and lack consistency when multiple instances are defined. The Shapeless library addresses some limitations by allowing automatic typeclass instance derivation based on a type's structure.
This document provides an introduction to the Kotlin programming language. It highlights several key features of Kotlin including static typing, null safety, type inference, immutability, fun syntax, classes, data classes, delegates, extensions, lambdas, and domain-specific languages (DSLs). It also summarizes new features being added in Kotlin 1.1 such as direct Java 8/9 support, type aliases, delegated properties everywhere, and coroutines with async/await. The document encourages the reader to start their journey with Kotlin and provides some links for additional resources.
The document provides an overview of functions in Swift including:
- Function format with parameters, return types, and body
- Calling functions and returning values
- Functions that return tuples
- External parameter names and shorthand names
- Default parameter values
- In-out parameters and call by reference
- Function types as parameters and return types
- Nested functions
The document contains examples and explanations of each concept over 37 slides.
ZIO Schedule: Conquering Flakiness & Recurrence with Pure Functional ProgrammingJohn De Goes
As professional software engineers, sometimes messy details of the real world stand in the way of us delivering principled software. Flaky connections, unreliable services, and bulletproof job scheduling in the presence of non-determinism and failure all tricky problems that discourage us from writing principled software. Yet sometimes the shortcuts we take to solve these problems result in downtime for the business and sleepless nights for us.
In this brand-new presentation, created exclusively for Scala in the City, John A. De Goes will show how functional programming can help bring order to even the most chaotic systems. Using ZIO, a new zero-dependency Scala library for building massively scalable asynchronous and concurrent applications, John will demonstrate how functional programming leverages reified effects and algebras to solve the trickiest of reliability and scheduling problems in a principled, composable, flexible way.
Join John for an evening of fun and functional programming as you explore fresh ways of thinking about reliability and scheduling, and come out of the talk with valuable skills for using ZIO to solve the everyday problems you encounter at work.
1. The document discusses various C++ concepts related to polymorphism and virtual functions including inheritance, upcasting, overriding virtual functions, pure virtual functions, virtual destructors, and operator overloading.
2. It provides code examples to demonstrate polymorphism with classes like Instrument, Wind, Pet and subclasses Dog and Cat.
3. It also shows examples of upcasting, downcasting using dynamic_cast, returning references/pointers to derived types, and ensuring proper object destruction with virtual destructors.
The document contains 11 programs written in the Bash shell scripting language. Program 1 concatenates the contents of two files into a third file. Program 2 calculates the sum, average, and product of 4 input numbers. Program 3 swaps the values of two variables without using a third variable.
Kotlin is a statically-typed programming language for the JVM and the browser, built by a team at JetBrains and designed as a pragmatic and easy-to-use Java alternative. In this presentation we'll explore the most notable Kotlin features, such as:
- Extension functions
- Null-safety
- Smart casts
- and many more
Check out and see that programming in Kotlin is fun!
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
An updated version of my talk on virtual machine cores comparing techniques in C and Go for implementing dispatch loops, stacks & hash maps.
Lots of tested and debugged code is provided as well as references to some useful/interesting books.
- Typeclasses in Scala allow defining common behavior (like printing) for unrelated types through implicit parameters and resolution. This avoids needing to modify types to add functionality.
- They work by defining typeclass traits that take a type parameter (like Show[T]), providing implicit values that implement traits for specific types, and having methods use implicit parameters of the typeclass.
- While powerful, typeclasses can cause issues like ambiguous implicits and lack consistency when multiple instances are defined. The Shapeless library addresses some limitations by allowing automatic typeclass instance derivation based on a type's structure.
This document provides an introduction to the Kotlin programming language. It highlights several key features of Kotlin including static typing, null safety, type inference, immutability, fun syntax, classes, data classes, delegates, extensions, lambdas, and domain-specific languages (DSLs). It also summarizes new features being added in Kotlin 1.1 such as direct Java 8/9 support, type aliases, delegated properties everywhere, and coroutines with async/await. The document encourages the reader to start their journey with Kotlin and provides some links for additional resources.
The document provides an overview of functions in Swift including:
- Function format with parameters, return types, and body
- Calling functions and returning values
- Functions that return tuples
- External parameter names and shorthand names
- Default parameter values
- In-out parameters and call by reference
- Function types as parameters and return types
- Nested functions
The document contains examples and explanations of each concept over 37 slides.
ZIO Schedule: Conquering Flakiness & Recurrence with Pure Functional ProgrammingJohn De Goes
As professional software engineers, sometimes messy details of the real world stand in the way of us delivering principled software. Flaky connections, unreliable services, and bulletproof job scheduling in the presence of non-determinism and failure all tricky problems that discourage us from writing principled software. Yet sometimes the shortcuts we take to solve these problems result in downtime for the business and sleepless nights for us.
In this brand-new presentation, created exclusively for Scala in the City, John A. De Goes will show how functional programming can help bring order to even the most chaotic systems. Using ZIO, a new zero-dependency Scala library for building massively scalable asynchronous and concurrent applications, John will demonstrate how functional programming leverages reified effects and algebras to solve the trickiest of reliability and scheduling problems in a principled, composable, flexible way.
Join John for an evening of fun and functional programming as you explore fresh ways of thinking about reliability and scheduling, and come out of the talk with valuable skills for using ZIO to solve the everyday problems you encounter at work.
1. The document discusses various C++ concepts related to polymorphism and virtual functions including inheritance, upcasting, overriding virtual functions, pure virtual functions, virtual destructors, and operator overloading.
2. It provides code examples to demonstrate polymorphism with classes like Instrument, Wind, Pet and subclasses Dog and Cat.
3. It also shows examples of upcasting, downcasting using dynamic_cast, returning references/pointers to derived types, and ensuring proper object destruction with virtual destructors.
There are many popular stream libraries for Scala developers, including Akka Streams, scalaz-stream, fs2, plus others in the Java ecosystem. While all excellent choices for building reactive Scala applications, their reliance on effects makes them particularly difficult to test and reason about. In this talk, long-time Scala functional programmer John A. De Goes takes to the stage to demonstrate a new approach to modeling streams that requires less machinery and has more reasoning power, composability, flexibility, and testability than many other approaches. By attending the talk, you'll learn how the best stream library may be the one you get for (co)free!
1. The document contains details of Pranav Ghildiyal, a class XII student. It includes a table of contents listing 24 programs with page numbers.
2. The programs cover concepts like arrays, structures, classes, inheritance, file handling, stacks, queues and more. Algorithms covered include sorting, searching and linked lists.
3. The document serves as an index for various C++ programs written by the student to demonstrate different concepts and data structures.
Highlights a bunch of different Python tricks and tips - from the stupid to the awesome (and a bit of both).
See how to register a 'str'.decode('hail_mary') codec, call_functions[1, 2, 3] instead of call_functions(1, 2, 3), creating a "Clojure-like" threading syntax by overloading the pipe operator, create useful equality mocks by overloading the equality operator, ditch JSON for pySON and put together a tiny lisp based on Norvig's awesome article.
Functional programming is a declarative programming paradigm that focuses on:
1) Using functions that have no side effects and are free of state;
2) Avoiding mutable data and side effects through immutable values and declarative code;
3) Expressing the logic of a computation without describing its control flow.
This document discusses Functional Programming in Scala. It includes an introduction to FP concepts like List and Cons using Scala code examples. It also provides code solutions to example problems involving List operations like foldRight, drop and dropWhile. The document recommends downloading exercise code and solutions from a GitHub repository to practice FP techniques presented in the book.
This document demonstrates features of the Reveal.js presentation software, including:
1) Presenting code, equations, computations, images, videos and iframes in slide outputs.
2) Syntax highlighting for code with animations and line highlighting.
3) Setting slide backgrounds, backgrounds for media, and positioning elements.
4) Auto-animating elements, using slide transitions, interactive widgets, themes and navigation tools.
The document introduces building a parser in PHP by explaining reasons for common fears around parsing, showing examples of language grammars like BNF and EBNF, and demonstrating how to generate a parser in PHP using PEG parsing expressions to parse a sample query language across multiple versions, with the potential to optimize parsed queries.
The document is a tutorial on programming with Python for Galois fields. It discusses how to import the FField class to work with Galois fields in Python, create a Galois field GF(2^3), represent elements as polynomials and coefficients, convert between representations, and perform addition and multiplication operations on elements in the field. Examples of Python code are provided to demonstrate working with Galois fields, obtaining polynomial and coefficient representations of elements, and using the FField class methods to operate on elements in the field.
Diving into byte code optimization in python Chetan Giridhar
The document discusses byte-code optimization in Python. It begins by explaining that Python source code is compiled into byte code, which is then executed by the CPython interpreter. It describes some of the key steps in the compilation process, including parsing the source code and generating an abstract syntax tree (AST) before compiling to bytecodes. The document then discusses some approaches for optimizing Python code at the byte-code level, including using tools like Pyrex, Psyco and the Python bytecode manipulation library BytePlay. It recommends always profiling applications to identify optimization opportunities and considering writing performance-critical portions as C extensions.
Perl is an open-source, cross-platform scripting language that is multi-paradigm and uses dynamic typing. It was created in 1987 and is popular for web programming using CGI scripts. Perl has scalars, arrays, hashes, and complex data types like references that allow it to represent complex data structures. It supports common programming constructs like conditionals, loops, subroutines, pattern matching and more.
The document provides an introduction to C++ programming. It outlines topics that will be covered, including basic syntax, compiling programs, passing arguments, dynamic memory allocation, and object-oriented programming. It recommends several useful books and web resources for learning C++ and offers a live coding demonstration of a simple image class to illustrate C++ concepts. The overall tone is informative but acknowledges that C++ is complex and learning requires practice.
The document discusses Swift's implicit features such as constants, variables, optionals, tuples, functions, operators, and structures. It provides examples of declaring constants and variables, optional binding, tuple decomposition, function parameters and return types, operator overloading, and defining structures. The document is intended to explain Swift's type inference and implicit features through code examples.
The document discusses strategies for understanding the CPython implementation of Python without reading the code. It recommends using observation and experimentation techniques like inspecting code behavior, examining commit histories, understanding internal structures through disassembly, running performance tests, and writing tests. Tools mentioned include inspect, timeit, and custom inspection modules. The key message is that these hands-on techniques allow one to critically examine and experiment with the code in ways that provide deeper understanding than just reading it.
FITC events. For digital creators.
Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca
An Intro To ES6
with Grant Skinner
OVERVIEW
ECMAScript 6 is the approved and published standard for the next version of JavaScript. It offers new syntax and language features that provide new ways of tackling coding problems, and increase your productivity.
This session will introduce ES6 and delve into many of the new features of the language. It will also cover real-world use, including transpilers, runtimes, and browser support.
OBJECTIVE
Create confidence in evaluating and getting started using ES6.
TARGET AUDIENCE
JavaScript developers.
ASSUMED AUDIENCE KNOWLEDGE
JavaScript.
FOUR THINGS AUDIENCE MEMBERS WILL LEARN
Status of ES6
How to get started with ES6
ES6 feature overview
Practical considerations for adopting ES6
The document provides an introduction to C++ programming. It outlines topics that will be covered such as basic syntax, compiling programs, argument passing, dynamic memory, and object-oriented programming. It recommends some useful books and websites for learning C++ and notes that the tutorial will demonstrate features of the language through examples while emphasizing learning through practice.
This document contains tips and explanations about various Ruby on Rails concepts and methods, including:
1) Object::try, which allows calling methods on an object that may be nil without raising an error.
2) Object::presence, which returns the object itself unless it is nil or an empty object, in which case it returns nil.
3) Object::send, which allows calling methods by name as a string, including private methods.
4) Other methods like freeze, inject, tap, and ways to extend Ruby classes are also explained briefly.
Kotlin offers a modern language design in contrast to Java, while at the same time maintaining full Java interoperably: Data classes, properties, delegation, inline functions, string interpolation and much more. But, if Java can't offer these features how come Kotlin can? What does Kotlin do to make it possible to use this Syntactic sugar?
In this talk, we will go backstage and dig into the Bytecode that Kotlin generates to make all the features we love work on a runtime that technically does not support them. We will look at the impact kotlin code generations has on method count. Get a deeper understanding of how Object and companion object work and see the implications of the use of either under different circumstances. Finally look at common patterns that can help reduce the size of both the bytecode and method count.
JavaZone 2022 - Building Kotlin DSL.pdfAnton Arhipov
The document discusses Kotlin DSL and provides examples of using Kotlin as a domain specific language. It demonstrates how to build type-safe builders using Kotlin, including defining DSL blocks, extension functions and properties, infix notation, lambda receivers, and context receivers to define internal and external DSLs. Code samples are provided of building clients and dates using DSL syntax and context requirements.
There are many popular stream libraries for Scala developers, including Akka Streams, scalaz-stream, fs2, plus others in the Java ecosystem. While all excellent choices for building reactive Scala applications, their reliance on effects makes them particularly difficult to test and reason about. In this talk, long-time Scala functional programmer John A. De Goes takes to the stage to demonstrate a new approach to modeling streams that requires less machinery and has more reasoning power, composability, flexibility, and testability than many other approaches. By attending the talk, you'll learn how the best stream library may be the one you get for (co)free!
1. The document contains details of Pranav Ghildiyal, a class XII student. It includes a table of contents listing 24 programs with page numbers.
2. The programs cover concepts like arrays, structures, classes, inheritance, file handling, stacks, queues and more. Algorithms covered include sorting, searching and linked lists.
3. The document serves as an index for various C++ programs written by the student to demonstrate different concepts and data structures.
Highlights a bunch of different Python tricks and tips - from the stupid to the awesome (and a bit of both).
See how to register a 'str'.decode('hail_mary') codec, call_functions[1, 2, 3] instead of call_functions(1, 2, 3), creating a "Clojure-like" threading syntax by overloading the pipe operator, create useful equality mocks by overloading the equality operator, ditch JSON for pySON and put together a tiny lisp based on Norvig's awesome article.
Functional programming is a declarative programming paradigm that focuses on:
1) Using functions that have no side effects and are free of state;
2) Avoiding mutable data and side effects through immutable values and declarative code;
3) Expressing the logic of a computation without describing its control flow.
This document discusses Functional Programming in Scala. It includes an introduction to FP concepts like List and Cons using Scala code examples. It also provides code solutions to example problems involving List operations like foldRight, drop and dropWhile. The document recommends downloading exercise code and solutions from a GitHub repository to practice FP techniques presented in the book.
This document demonstrates features of the Reveal.js presentation software, including:
1) Presenting code, equations, computations, images, videos and iframes in slide outputs.
2) Syntax highlighting for code with animations and line highlighting.
3) Setting slide backgrounds, backgrounds for media, and positioning elements.
4) Auto-animating elements, using slide transitions, interactive widgets, themes and navigation tools.
The document introduces building a parser in PHP by explaining reasons for common fears around parsing, showing examples of language grammars like BNF and EBNF, and demonstrating how to generate a parser in PHP using PEG parsing expressions to parse a sample query language across multiple versions, with the potential to optimize parsed queries.
The document is a tutorial on programming with Python for Galois fields. It discusses how to import the FField class to work with Galois fields in Python, create a Galois field GF(2^3), represent elements as polynomials and coefficients, convert between representations, and perform addition and multiplication operations on elements in the field. Examples of Python code are provided to demonstrate working with Galois fields, obtaining polynomial and coefficient representations of elements, and using the FField class methods to operate on elements in the field.
Diving into byte code optimization in python Chetan Giridhar
The document discusses byte-code optimization in Python. It begins by explaining that Python source code is compiled into byte code, which is then executed by the CPython interpreter. It describes some of the key steps in the compilation process, including parsing the source code and generating an abstract syntax tree (AST) before compiling to bytecodes. The document then discusses some approaches for optimizing Python code at the byte-code level, including using tools like Pyrex, Psyco and the Python bytecode manipulation library BytePlay. It recommends always profiling applications to identify optimization opportunities and considering writing performance-critical portions as C extensions.
Perl is an open-source, cross-platform scripting language that is multi-paradigm and uses dynamic typing. It was created in 1987 and is popular for web programming using CGI scripts. Perl has scalars, arrays, hashes, and complex data types like references that allow it to represent complex data structures. It supports common programming constructs like conditionals, loops, subroutines, pattern matching and more.
The document provides an introduction to C++ programming. It outlines topics that will be covered, including basic syntax, compiling programs, passing arguments, dynamic memory allocation, and object-oriented programming. It recommends several useful books and web resources for learning C++ and offers a live coding demonstration of a simple image class to illustrate C++ concepts. The overall tone is informative but acknowledges that C++ is complex and learning requires practice.
The document discusses Swift's implicit features such as constants, variables, optionals, tuples, functions, operators, and structures. It provides examples of declaring constants and variables, optional binding, tuple decomposition, function parameters and return types, operator overloading, and defining structures. The document is intended to explain Swift's type inference and implicit features through code examples.
The document discusses strategies for understanding the CPython implementation of Python without reading the code. It recommends using observation and experimentation techniques like inspecting code behavior, examining commit histories, understanding internal structures through disassembly, running performance tests, and writing tests. Tools mentioned include inspect, timeit, and custom inspection modules. The key message is that these hands-on techniques allow one to critically examine and experiment with the code in ways that provide deeper understanding than just reading it.
FITC events. For digital creators.
Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca
An Intro To ES6
with Grant Skinner
OVERVIEW
ECMAScript 6 is the approved and published standard for the next version of JavaScript. It offers new syntax and language features that provide new ways of tackling coding problems, and increase your productivity.
This session will introduce ES6 and delve into many of the new features of the language. It will also cover real-world use, including transpilers, runtimes, and browser support.
OBJECTIVE
Create confidence in evaluating and getting started using ES6.
TARGET AUDIENCE
JavaScript developers.
ASSUMED AUDIENCE KNOWLEDGE
JavaScript.
FOUR THINGS AUDIENCE MEMBERS WILL LEARN
Status of ES6
How to get started with ES6
ES6 feature overview
Practical considerations for adopting ES6
The document provides an introduction to C++ programming. It outlines topics that will be covered such as basic syntax, compiling programs, argument passing, dynamic memory, and object-oriented programming. It recommends some useful books and websites for learning C++ and notes that the tutorial will demonstrate features of the language through examples while emphasizing learning through practice.
This document contains tips and explanations about various Ruby on Rails concepts and methods, including:
1) Object::try, which allows calling methods on an object that may be nil without raising an error.
2) Object::presence, which returns the object itself unless it is nil or an empty object, in which case it returns nil.
3) Object::send, which allows calling methods by name as a string, including private methods.
4) Other methods like freeze, inject, tap, and ways to extend Ruby classes are also explained briefly.
Kotlin offers a modern language design in contrast to Java, while at the same time maintaining full Java interoperably: Data classes, properties, delegation, inline functions, string interpolation and much more. But, if Java can't offer these features how come Kotlin can? What does Kotlin do to make it possible to use this Syntactic sugar?
In this talk, we will go backstage and dig into the Bytecode that Kotlin generates to make all the features we love work on a runtime that technically does not support them. We will look at the impact kotlin code generations has on method count. Get a deeper understanding of how Object and companion object work and see the implications of the use of either under different circumstances. Finally look at common patterns that can help reduce the size of both the bytecode and method count.
JavaZone 2022 - Building Kotlin DSL.pdfAnton Arhipov
The document discusses Kotlin DSL and provides examples of using Kotlin as a domain specific language. It demonstrates how to build type-safe builders using Kotlin, including defining DSL blocks, extension functions and properties, infix notation, lambda receivers, and context receivers to define internal and external DSLs. Code samples are provided of building clients and dates using DSL syntax and context requirements.
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
Dopo 20 anni Java inizia a sentire il peso degli anni e la sua sintassi non evolve come vorremmo, ma la JVM resta sempre un ambiente affidabile ed è già in produzione presso moltissime aziende. Negli ultimi anni sono usciti molti linguaggi basati sulla JVM, ma non tutti hanno avuto il successo sperato. Kotlin ha conquistato Android e, ora, grazie a una sintassi intuitiva e grandi aziende che lo supportano potrebbe essere molto utilizzato anche nelle applicazioni web. Durante il talk vedremo le basi del linguaggio e come sviluppare una applicazione web pronta ad andare in produzione.
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Waytdc-globalcode
This document discusses Domain Specific Languages (DSLs) in Kotlin and provides examples of building DSLs using Kotlin features like extension functions, operators, and receivers. It covers topics like infix notation, operator overloading, building query DSLs, mocking HTTP responses, and more. The document concludes that DSLs can improve existing domains and encourage designing your own DSLs for fun and learning.
Functions in Objective-C and C ProgrammingPaul Solt
Course Link: http://skl.sh/11kA0im
Website: http://iPhoneDev.tv
Learn about functions which allow you to organize your code into chunks. Functions allow you to delegate work between different blocks of code.
Kotlin is a modern statically typed programming language which was made a first-class language for writing Android Apps by Google in 2017. Since then it has grown into popularity and many apps from hottest startups to 500 fortune companies are built using Kotlin. This talk will deep dive into Kotlin and modern android architecture for writing apps faster and in a better way.
This talk will explore inference from the perspective of protocols and generics and is based off a series of blog posts I've written(foxinswift.com) on the topic. In the first part of my talk casting number types through inference. I'll then show you struct serialization example demonstrating inferring a type through a mapping function. My last example will take you through inferring an associatedtype on a barebones promise implementation and we'll use it to in the context of making a network request. To finish things off I'll briefly speak on what's new in swift generics and some limitations of those features.
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)AvitoTech
В своём докладе Влад будет говорить об использовании STL, управлении памятью, как работает ARC и C++, лямбды и блоки. И самое главное: где и как можно «выстрелить себе в ногу».
Get Functional on the CLR: Intro to Functional Programming with F# David Alpert
The document introduces functional programming concepts and the F# programming language. It aims to help readers disambiguate functional programming, demystify F# syntax, demonstrate .NET interoperability, and experiment with basic F# functions and data structures. The document provides an overview of functional programming principles, compares F# and C# syntax, demonstrates rapid prototyping using F# Interactive, and shows how to create and test F# libraries from C#.
This document contains the slides from a presentation on effective C# programming. It discusses various C# language features and best practices, including:
- The difference between string and String, and why to prefer string
- Using StringBuilder for string concatenation instead of '+' for performance
- Strongly typed vs dynamic typing with var
- Overloading, overriding, and polymorphism
- Equality comparisons and operators for strings
- Inheritance, overriding, and avoiding the new keyword
- Generating test data efficiently
- Differences between the CLR and C# and assembly compatibility
- Using properties instead of public fields
- Readonly vs const and their implications
- Structs vs classes and value types vs reference
The document discusses new features in C# 7.0 including tuples, pattern matching, out variables, and more. It provides code examples demonstrating how to use tuples to return multiple values from functions, type patterns to match types in switch statements, and when conditions to add additional checks to case statements. The examples show enhanced control flow options in C# with these new features.
The document discusses Kotlin DSL and how it can be used to create domain-specific languages. It provides examples of using Kotlin features like operators, lambdas, and extensions to build DSLs for validation rules, UI layouts, dependency injection, and more. Key points include how functions, operators, and properties can be overridden or extended to define new syntax and behaviors for DSLs, and how inline functions allow embedding DSL code without additional overhead.
From java to kotlin beyond alt+shift+cmd+kFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay! Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write. In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
01 Introduction to Kotlin - Programming in Kotlin.pptxIvanZawPhyo
Kotlin is a programming language that is expressive, concise, and portable. It runs on the Java Virtual Machine and is fully interoperable with Java. Kotlin focuses on safety, interoperability, and tooling support. The basics of Kotlin include top-level functions, variables, if/when expressions, loops, ranges, null safety features, and string templates. Kotlin avoids null pointer exceptions through language features like the Elvis operator, safe calls, and non-null types.
Kotlin is a programming language that is expressive, concise, and portable. It runs on the Java Virtual Machine and is fully interoperable with Java. Kotlin focuses on safety, interoperability, and tooling support. The basics of Kotlin include top-level functions, variables, if/when expressions, loops, ranges, null safety features, and string templates. Kotlin avoids null pointer exceptions through language features like the Elvis operator, safe calls, and non-null types.
The document discusses various concepts related to arrays in C/C++ including:
- What an array is and its key properties like contiguous memory locations and common data type
- Different types of arrays like single dimensional and multi dimensional
- How to declare, initialize and access array elements
- Passing arrays to functions
- Searching and sorting arrays
- Common array operations like insertion and deletion
Не так давно вышел C# 6, основанный на новом компиляторе Roslyn. Обновление языка содержит большое количество приятных синтаксических конструкций, которые упрощают написание кода и делают его более лаконичным. Но Microsoft на этом не успокоились: прямо сейчас ведётся работа над 7-ой версией языка, которую планируют сделать ещё удобнее, благодаря реализации современных тенденций написания кода. В этом докладе мы поговорим о том, что может войти в C# 7. В числе прочего будут обсуждаться Tuples, Pattern matching, Records / algebraic data types, Nullability tracking и многое другое.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Tatiana Kojar
Skybuffer AI, built on the robust SAP Business Technology Platform (SAP BTP), is the latest and most advanced version of our AI development, reaffirming our commitment to delivering top-tier AI solutions. Skybuffer AI harnesses all the innovative capabilities of the SAP BTP in the AI domain, from Conversational AI to cutting-edge Generative AI and Retrieval-Augmented Generation (RAG). It also helps SAP customers safeguard their investments into SAP Conversational AI and ensure a seamless, one-click transition to SAP Business AI.
With Skybuffer AI, various AI models can be integrated into a single communication channel such as Microsoft Teams. This integration empowers business users with insights drawn from SAP backend systems, enterprise documents, and the expansive knowledge of Generative AI. And the best part of it is that it is all managed through our intuitive no-code Action Server interface, requiring no extensive coding knowledge and making the advanced AI accessible to more users.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
A Comprehensive Guide to DeFi Development Services in 2024Intelisync
DeFi represents a paradigm shift in the financial industry. Instead of relying on traditional, centralized institutions like banks, DeFi leverages blockchain technology to create a decentralized network of financial services. This means that financial transactions can occur directly between parties, without intermediaries, using smart contracts on platforms like Ethereum.
In 2024, we are witnessing an explosion of new DeFi projects and protocols, each pushing the boundaries of what’s possible in finance.
In summary, DeFi in 2024 is not just a trend; it’s a revolution that democratizes finance, enhances security and transparency, and fosters continuous innovation. As we proceed through this presentation, we'll explore the various components and services of DeFi in detail, shedding light on how they are transforming the financial landscape.
At Intelisync, we specialize in providing comprehensive DeFi development services tailored to meet the unique needs of our clients. From smart contract development to dApp creation and security audits, we ensure that your DeFi project is built with innovation, security, and scalability in mind. Trust Intelisync to guide you through the intricate landscape of decentralized finance and unlock the full potential of blockchain technology.
Ready to take your DeFi project to the next level? Partner with Intelisync for expert DeFi development services today!
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
10. Classes
public final class Speaker {
public final String; talk
@JvmField;() // invisible
@NotNull;() // invisible
public <init>(String;)V { … }
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
11. Nulls
fun len(str: String) = str.length
fun maybeLen(str: String?) = str?.length ?: 0
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
32. final class TopicFragment$1
extends FunctionReference implements Function1 {
public synthetic bridge invoke(Object;)
public final invoke(I)Z
public final getOwner()KDeclarationContainer;
public final getName()String;
public final getSignature()String;
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
38. Data Classes
data class Speaker(
val description: String,
val talks: List<Talk>,
val profile: String
)
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
39. De-structure data class
val speaker = Speaker(
talks = arrayListOf(),
description = "Bytecode",
profile = ""
)
val (description, talks) = speaker
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
40. public final component1()String;
@NotNull;() // invisible
ALOAD 0
GETFIELD Speaker.description : String;
ARETURN
// signature ()LList<LTalk;>;
// declaration: java.util.List<Talk> component2()
public final component2()LList;
@NotNull;() // invisible
ALOAD 0
GETFIELD Speaker.talks : LList;
ARETURN
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
47. SAMs
final class Sam$1 implements View$OnClickListener {
public final onClick(Landroid/view/View;)V
LDC "Hello"
INVOKEVIRTUAL PrintStream.print (Object;)V
RETURN
<init>()V
INVOKESPECIAL Object.<init> ()V
RETURN
public final static Sam$1; INSTANCE
static <clinit>()V
NEW Sam$1
DUP
INVOKESPECIAL Sam$1.<init> ()V
PUTSTATIC Sam$1.INSTANCE : Sam$1;
RETURN
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
48. class Lmd {
private val lambda = {
"I'm a lambda"
}
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
49. public final class Lmd {
// signature Function0<String;>;
// declaration: Function0<java.lang.String>
private final Function0; lambda
public <init>()V
// …
ALOAD 0
GETSTATIC Lmd$lambda$1.INSTANCE : Lmd$lambda$1;
CHECKCAST Function0
PUTFIELD Lmd.lambda : Function0;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
50. final class Lmd$lambda$1
extends Lambda
implements Function0 {
<init>()V
INVOKESPECIAL Lambda.<init> (I)V
RETURN
public final static Lmd$lambda$1; INSTANCE
static <clinit>()V
NEW Lmd$lambda$1
DUP
INVOKESPECIAL Lmd$lambda$1.<init> ()V
PUTSTATIC Lmd$lambda$1.INSTANCE : Lmd$lambda$1;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
51. public synthetic bridge invoke()Object;
L0
LINENUMBER 3 L0
ALOAD 0
INVOKEVIRTUAL Lmd$lambda$1.invoke ()String;
ARETURN
// access flags 0x11
public final invoke()String;
@NotNull;() // invisible
L0
LINENUMBER 5 L0
LDC "I'm a lambda"
L1
ARETURN
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
52. class Lmd {
private val lambda = {
"I'm a lambda"
}
val value = lambda()
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
53. public final class Lmd {
public <init>()V
…
ALOAD 0
GETFIELD Lmd.lambda : Function0;
INVOKEINTERFACE Function0.invoke ()Object;
CHECKCAST String
}
final class public Lmd$lambda$1 {
public synthetic bridge invoke()Object;
Lmd$lambda$1.invoke ()String;
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
54. Lambda s and Field
class Lmd (
private val speaker: Speaker
) {
private val lambda = {
speaker.name
}
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
55. final class Lmd$lambda$1 {
final synthetic Lmd; this$0
public final invoke()String;
@NotNull;() // invisible
GETFIELD Lmd$lambda$1.this$0 : Lmd;
INVOKESTATIC Lmd.access$getSpeaker$p (Lmd;)LSpeaker;
INVOKEVIRTUAL Speaker.getName ()String;
ARETURN
<init>(Lmd;)V
PUTFIELD Lmd$lambda$1.this$0 : Lmd;
INVOKESPECIAL Lambda.<init> (I)V
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
56. final class Lmd$lambda$1 {
final synthetic Lmd; this$0
public final invoke()String;
@NotNull;() // invisible
GETFIELD Lmd$lambda$1.this$0 : Lmd;
INVOKESTATIC Lmd.access$getSpeaker$p (Lmd;)LSpeaker;
INVOKEVIRTUAL Speaker.getName ()String;
ARETURN
<init>(Lmd;)V
PUTFIELD Lmd$lambda$1.this$0 : Lmd;
INVOKESPECIAL Lambda.<init> (I)V
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
57. public final class Lmd {
public final static synthetic access$getSpeaker$p(Lmd;)Speaker;
@NotNull;() // invisible
ALOAD 0
GETFIELD Lmd.speaker : Speaker;
ARETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
58. class Lmd (
@JvmField protected
private val speaker: Speaker
){
private val lambda = {
speaker.name
}
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
62. // file name Objects
private val speaker = Speaker()
public final class ObjectsKt {
private final static Speaker; speaker
static <clinit>()V
NEW Speaker
DUP
INVOKESPECIAL Speaker.<init> ()V
PUTSTATIC ObjectsKt.speaker : LSpeaker;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
63. // file name Objects
private val speaker = Speaker()
public final class ObjectsKt {
private final static Speaker; speaker
static <clinit>()V
NEW Speaker
DUP
INVOKESPECIAL Speaker.<init> ()V
PUTSTATIC ObjectsKt.speaker : LSpeaker;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
64. fun someStr() = "Some String"
// Becomes
public final class ObjectsKt {
public final static someStr() String;
@NotNull;() // invisible
LDC "Some String"
ARETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
70. public final class AnObject {
public final static AnObject; INSTANCE
private <init>()V
INVOKESPECIAL Object.<init> ()V
RETURN
static <clinit>()V
NEW AnObject
DUP
INVOKESPECIAL AnObject.<init> ()V
PUTSTATIC AnObject.INSTANCE : AnObject;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
71. object AnObject {
val name = "Mitchell"
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
72. public final class AnObject {
private final static String; name = "Mitchell"
@NotNull;() // invisible
public final getName()String;
@NotNull;() // invisible
GETSTATIC AnObject.name : String;
ARETURN
static <clinit>()V
LDC "Mitchell"
PUTSTATIC AnObject.name : String;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
73. object AnObject {
const val name = "Mitchell"
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
74. public final class AnObject {
public final static String; name = "Mitchell"
public final static LAnObject; INSTANCE
private <init>()V
INVOKESPECIAL Object.<init> ()V
RETURN
static <clinit>()V
NEW AnObject
DUP
INVOKESPECIAL AnObject.<init> ()V
PUTSTATIC AnObject.INSTANCE : LAnObject;
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
76. public final class AnObject {
public final speaker() Speaker;
@NotNull;() // invisible
NEW Speaker
DUP
INVOKESPECIAL Speaker.<init> ()V
ARETURN
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
77. object AnObject {
@JvmStatic
fun speaker() = Speaker()
}
// With @JvmStatic
public final class AnObject {
public final static speaker() Speaker;
@JvmStatic;()
@NotNull;() // invisible
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
80. public final class TopicFragment {
public <init>()V
static <clinit>()V
NEW TopicFragment$Companion
DUP
ACONST_NULL
INVOKESPECIAL TopicFragment$Companion.<init> (
DefaultConstructorMarker;
)V
PUTSTATIC TopicFragment.Companion : TopicFragment$Companion;
RETURN
public final static TopicFragment$Companion; Companion
public final static INNERCLASS
TopicFragment$Companion TopicFragment Companion
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
81. public final class TopicFragment$Companion {
private <init>()V
INVOKESPECIAL Object.<init> ()V
RETURN
public synthetic <init>(DefaultConstructorMarker;)V
INVOKESPECIAL TopicFragment$Companion.<init> ()V
RETURN
public final static INNERCLASS
TopicFragment$Companion TopicFragment Companion
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
82. class TopicFragment {
companion object {
val EXTRA_TOPIC_ID = "EXTRA_TOPIC_ID"
}
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
84. public final class TopicFragment {
private final static String; EXTRA_TOPIC_ID =
"EXTRA_TOPIC_ID"
static <clinit>()V
NEW TopicFragment$Companion
…
LDC "EXTRA_TOPIC_ID"
PUTSTATIC TopicFragment
.EXTRA_TOPIC_ID : String;
RETURN
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
85. public final class TopicFragment {
public <init>()V
GETSTATIC Companion : $Companion;
INVOKEVIRTUAL $Companion
.getEXTRA_TOPIC_ID ()String;
POP
…
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
86. public final class TopicFragment$Companion {
public final getEXTRA_TOPIC_ID()String;
@NotNull;() // invisible
L0
LINENUMBER 11 L0
INVOKESTATIC TopicFragment.access$getEXTRA_TOPIC_ID$cp ()String;
ARETURN
}
public final class TopicFragment {
public final static synthetic access$getEXTRA_TOPIC_ID$cp()String;
@NotNull;() // invisible
GETSTATIC TopicFragment.EXTRA_TOPIC_ID : String;
ARETURN
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
89. public final class TopicFragment {
public <init>()V
INVOKESPECIAL Object.<init> ()V
// Now all we get is metadata
LINENUMBER 6 L1
RETURN
public final static String; EXTRA_TOPIC_ID =
"EXTRA_TOPIC_ID"
@NotNull;() // invisible
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
90. package io.github.droidkaigi.confsched2018.data.api.response.mapper
class LocalDateTimeAdapter : JsonAdapter<LocalDateTime>() {
companion object {
private val FORMATTER: DateTimeFormatter =
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")
fun parseDateString(dateString: String?): LocalDateTime =
LocalDateTime.parse(dateString, FORMATTER)
}
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
92. /* package private */ final class FormatCompanion {
public final static DateTimeFormatter; FORMATTER
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
93. class TopicFragment {
companion object {
private const val EXTRA_TOPIC_ID = "EXTRA_TOPIC_ID"
fun newInstance(topicId: Int) {
}
}
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
94. Reducing Synthetic Methods
class TopicDetailViewModel
@Inject constructor(
private val repository: SessionRepository,
private val schedulerProvider: SchedulerProvider
) : ViewModel(), LifecycleObserver {
var topicId: Int = 0
val topicSessions: LiveDataSessions by lazy {
repository.topicSessions
.map {
it
.filter { it.key.id == topicId }
.map { it.key to it.value }
.first()
}
.toResult(schedulerProvider)
.toLiveData()
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
95. public final class TopicDetailViewModel
extends android/arch/lifecycle/ViewModel
implements android/arch/lifecycle/LifecycleObserver {
public final static synthetic access$getRepository
$p(LTopicDetailViewModel;)SessionRepository;
@NotNull;() // invisible
L0
LINENUMBER 20 L0
ALOAD 0
GETFIELD TopicDetailViewModel.repository : SessionRepository;
ARETURN
public final static synthetic access$getSchedulerProvider
$p(LTopicDetailViewModel;)SchedulerProvider;
@NotNull;() // invisible
L0
LINENUMBER 20 L0
ALOAD 0
GETFIELD TopicDetailViewModel.schedulerProvider : SchedulerProvider;
ARETURN
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
96. class TopicDetailViewModel
@Inject constructor(
private val repository: SessionRepository,
private val schedulerProvider: SchedulerProvider
) : ViewModel(), LifecycleObserver {
var topicId: Int = 0
val topicSessions: LiveDataSessions by lazy {
repository.topicSessions
.map {
it
.filter { it.key.id == topicId }
.map { it.key to it.value }
.first()
}
.toResult(schedulerProvider)
.toLiveData()
}
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders
98. // protected is effectively private in final classes
class TopicDetailViewModel
@Inject
@Suppress("warnings")
constructor(
@JvmField protected
val repository: SessionRepository,
@JvmField protected
val schedulerProvider: SchedulerProvider
)
Mitchell Tilbook @sir_tilbrook
youtube.com/c/anzcoders