Slides from my talk at Kyiv Kotlin User Group: First Blood, 2017-12-12
Video: https://youtu.be/s2m1w8t7k3Y?t=5730
The Delegation pattern is an OOD pattern that allows object composition to achieve the same code reuse as inheritance.
Let's find out what Kotlin offers us in a world where we have no control over the creation of many objects to save our time in many cases.
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Tudor Dragan
Kotlin is a powerful language, but it also comes with its traps and pitfalls. This presentation is about uncovering the very nice features and strange particularities that the language has to offer.
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...John De Goes
Maybe you've played around with functional programming before, but don't consider yourself a functional programmer. Or maybe you program functionally, but only in a dynamically-typed programming language. Or MAYBE you just like workshops with really long, ridiculously-sounding titles!
No matter, this workshop that teaches the super hot programming language PureScript is guaranteed to cure what ails you!
Come, learn about functions, learn about types, learn about data, and learn about how to smash them all together to build beautiful programs that are easy to test, easy to combine, and easy to reason about.
Become the functional programmer you were born to be!
"We’ve all seen poorly written code that’s hard to understand, test, and maintain. Object-oriented programming promised to save us from our old procedural code, allowing us to write software incrementally, reusing as we go along. But sometimes it seems like we’re just chasing down the same old complex, coupled designs in Java that we had in C.
Good object-oriented design is hard to learn. Transitioning from procedural development to
object-oriented design requires a major shift in thinking that is more difficult than it seems.
Many developers assume they’re doing a good job with OO design, when in reality they’re
unconsciously stuck in old habits that are hard to break. It doesn’t help that many examples and best practices (even Sun’s code in the JDK) encourage poor OO design in the name of
performance or simple weight of history." -- Jeff Bay
Here are some key rules which are going to improve your OO designing skills and make you a better programmer. Some are harder to implement but will open your mind for new ways of coding. Happy coding! :)
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Tudor Dragan
Kotlin is a powerful language, but it also comes with its traps and pitfalls. This presentation is about uncovering the very nice features and strange particularities that the language has to offer.
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...John De Goes
Maybe you've played around with functional programming before, but don't consider yourself a functional programmer. Or maybe you program functionally, but only in a dynamically-typed programming language. Or MAYBE you just like workshops with really long, ridiculously-sounding titles!
No matter, this workshop that teaches the super hot programming language PureScript is guaranteed to cure what ails you!
Come, learn about functions, learn about types, learn about data, and learn about how to smash them all together to build beautiful programs that are easy to test, easy to combine, and easy to reason about.
Become the functional programmer you were born to be!
"We’ve all seen poorly written code that’s hard to understand, test, and maintain. Object-oriented programming promised to save us from our old procedural code, allowing us to write software incrementally, reusing as we go along. But sometimes it seems like we’re just chasing down the same old complex, coupled designs in Java that we had in C.
Good object-oriented design is hard to learn. Transitioning from procedural development to
object-oriented design requires a major shift in thinking that is more difficult than it seems.
Many developers assume they’re doing a good job with OO design, when in reality they’re
unconsciously stuck in old habits that are hard to break. It doesn’t help that many examples and best practices (even Sun’s code in the JDK) encourage poor OO design in the name of
performance or simple weight of history." -- Jeff Bay
Here are some key rules which are going to improve your OO designing skills and make you a better programmer. Some are harder to implement but will open your mind for new ways of coding. Happy coding! :)
Let's make a contract: the art of designing a Java APIMario Fusco
An API is what developers use to achieve some task. More precisely it establishes a contract between them and the designers of the software exposing its services through that API. In this sense we're all API designers: our software doesn't work in isolation, but becomes useful only when it interacts with other software written by other developers. When writing software we're not only consumers, but also providers of one or more API and that's why every developer should know the features of a good API. During this presentation we will go through real-world examples, also taken from the standard Java API, of good and bad API and comment them in order to show the dos and don'ts of API design. More in general we will discuss the characteristics of an easy and pleasant to use API, like consistency, discoverability and understandability, together with some basic concepts like the principle of least astonishment, and find out how to achieve them.
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
All Aboard The Scala-to-PureScript Express!John De Goes
Many Scala programmers have embraced functional programming, but the syntax and semantics of programming languages in the Haskell family remains a mystery. In this talk, Scala developers (and to some extent, Java developers) will see how the types, data structures, traits / interfaces, packages, and so forth translate into their PureScript counterparts.
Monads, also known as Kleisli triples in Category Theory, are an (endo-)functor together with two natural transformations, which are surprisingly useful in pure languages like Haskell, but this talk will NOT reference monads. Ever. (Well, at least not in this talk.)
Instead what I intend to impress upon an audience of newcomers to Haskell is the wide array of freely available libraries most of which are liberally licensed open source software, intuitive package management, practical build tools, reasonable documentation (when you know how to read it and where to find it), interactive shell (or REPL), mature compiler, stable runtime, testing tools that will blow your mind away, and a small but collaborative and knowledgeable community of developers. Oh, and some special features of Haskell - the language - too!
"Delegates, Delegates everywhere" Владимир МироновAvitoTech
Поговорим про delegated properties и все, что с ними связано. Узнаем, зачем они нужны, какие delegated properties предоставляет стандартная библиотека, напишем несколько своих и рассмотрим более сложные примеры, которые могут быть полезны в мире android-разработки. Мы также посмотрим, во что delegated properties превращаются во время компиляции, и какие сюрпризы нас могут ожидать.
Let's make a contract: the art of designing a Java APIMario Fusco
An API is what developers use to achieve some task. More precisely it establishes a contract between them and the designers of the software exposing its services through that API. In this sense we're all API designers: our software doesn't work in isolation, but becomes useful only when it interacts with other software written by other developers. When writing software we're not only consumers, but also providers of one or more API and that's why every developer should know the features of a good API. During this presentation we will go through real-world examples, also taken from the standard Java API, of good and bad API and comment them in order to show the dos and don'ts of API design. More in general we will discuss the characteristics of an easy and pleasant to use API, like consistency, discoverability and understandability, together with some basic concepts like the principle of least astonishment, and find out how to achieve them.
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
All Aboard The Scala-to-PureScript Express!John De Goes
Many Scala programmers have embraced functional programming, but the syntax and semantics of programming languages in the Haskell family remains a mystery. In this talk, Scala developers (and to some extent, Java developers) will see how the types, data structures, traits / interfaces, packages, and so forth translate into their PureScript counterparts.
Monads, also known as Kleisli triples in Category Theory, are an (endo-)functor together with two natural transformations, which are surprisingly useful in pure languages like Haskell, but this talk will NOT reference monads. Ever. (Well, at least not in this talk.)
Instead what I intend to impress upon an audience of newcomers to Haskell is the wide array of freely available libraries most of which are liberally licensed open source software, intuitive package management, practical build tools, reasonable documentation (when you know how to read it and where to find it), interactive shell (or REPL), mature compiler, stable runtime, testing tools that will blow your mind away, and a small but collaborative and knowledgeable community of developers. Oh, and some special features of Haskell - the language - too!
"Delegates, Delegates everywhere" Владимир МироновAvitoTech
Поговорим про delegated properties и все, что с ними связано. Узнаем, зачем они нужны, какие delegated properties предоставляет стандартная библиотека, напишем несколько своих и рассмотрим более сложные примеры, которые могут быть полезны в мире android-разработки. Мы также посмотрим, во что delegated properties превращаются во время компиляции, и какие сюрпризы нас могут ожидать.
In this talk I presented three important topics in Kotlin Standard Library: Scope Functions (let, apply, also, run and with); Annotations (Deprecated, Experimental, Jvm*, DslMarker); and Delegates (lazy, vetoable, observable)
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.
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)James Titcumb
Have you ever used PHP's built in reflection, only to find you can't do quite what you wanted? What about finding types for parameters or properties? What about reflecting on classes that aren't loaded, so that you can modify them directly?
Better Reflection is an awesome new library that uses magical time-warp techniques* (*actual magic or time-warp not guaranteed) to improve on PHP's built-in reflection by providing additional functionality. In this talk we'll cover what reflection is all about, explore the cool features of Better Reflection already implemented, the difficulties we faced actually writing the thing, and how you can use Better Reflection in your projects to maximise your reflection-fu.
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...James Titcumb
Have you ever used PHP’s built in reflection, only to find you can’t do quite what you wanted? What about finding types for parameters or properties? What about reflecting on classes that aren’t loaded, so that you can modify them directly?
Better Reflection is an awesome new library that uses magical time-warp techniques* to improve on PHP’s built-in reflection by providing additional functionality. In this talk we’ll cover what reflection is all about, explore the cool features of Better Reflection already implemented, the difficulties we faced actually writing the thing, and how you can use Better Reflection in your projects to maximise your reflection-fu.
(*actual magic or time-warp not guaranteed)
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.
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018 Codemotion
I Google Developer Group (GDG) sono una community internazionale di appassionati delle tecnologie: sviluppatori, designer e startupper. Sono suddivisi per città, e GDG Italia è la famiglia che rappresenta tutti i gruppi presenti sul territorio locale. Mike Trizio e Carmelo Ventimiglia introdurranno i GDG, le loro attività e perchè è utile e divertente farne parte. Leonardo Pirro invece ci introdurrà Kotlin, un linguaggio di programmazione che ha avuto un crescente successo negli ultimi anni. Analizzeremo le caratteristiche principali del linguaggio e i suoi vantaggi/benefici rispetto a Java.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
13. Translation rule
public final class Window implements Area {
// $FF: synthetic field
private final Rectangle $$delegate_0 = new Rectangle(10, 10);
public int area() {
return this.$$delegate_0.area();
}
}
16. When I should care?
When you want to extend the
behavior of classes that you cannot
or don’t want to subclass because…
17. Encapsulation, thou art a heartless bitch
×Classes are final (e.g. File)
×You offer a limited API, using 98% of the existing code
×You want to hide the implementation from calling
code, so clients cannot cast to the superclass
19. What properties would we like to have?
×Lazy (computed only upon first access)
×Observable (listeners get notified about changes)
×Storing in a map, not in separate field each
×<Whatever I want property semantics>
21. Val / Var: define an operator
// For val
operator fun getValue(thisRef: R, prop: KProperty<*>): T
// For var
operator fun getValue(thisRef: R, prop: KProperty<*>): T
operator fun setValue(thisRef: R, prop: KProperty<*>, value: T)
Property
metadata
Property owner
22. Val / Var: or implement an interface
// For val
interface ReadOnlyProperty<in R, out T> {
operator fun getValue(thisRef: R, prop: KProperty<*>): T
}
// For var
interface ReadWriteProperty<in R, T> {
operator fun getValue(thisRef: R, prop: KProperty<*>): T
operator fun setValue(thisRef: R, prop: KProperty<*>, value: T)
}
23. Read Only Properties
class Person {
val name: String by NameVal()
}
class NameVal: ReadOnlyProperty<Person, String> {
override fun getValue(thisRef: Person, prop: KProperty<*>): String {
return "$thisRef, thank you for delegating '${prop.name}' to me!"
}
}
24. Read-Write Properties
class Person {
var name: String by NameVar()
}
class NameVar: ReadWriteProperty<Person, String> {
override fun getValue(…): { … }
override fun setValue(thisRef: Person, prop: KProperty<*>, value: String) {
println("$value has been assigned to '${prop.name} in $thisRef.'")
}
}
25. This is generated by the compiler insteadpublic final class Person {
// $FF: synthetic field
static final KProperty[] $$delegatedProperties = new KProperty[]{ /* Nightmare */ }
@NotNull private final NameVar name$delegate = new NameVar();
@NotNull public final String getName() {
return this.name$delegate.getValue(this, $$delegatedProperties[0]);
}
public final void setName(@NotNull String var1) {
Intrinsics.checkParameterIsNotNull(var1, "<set-?>");
this.name$delegate.setValue(this, $$delegatedProperties[0], var1);
}
}
33. Map
class Person(map: Map<String, Any?>) {
val name: String by map
val age: Int by map
}
class PersonWrapper(map: Map<String, Any?>) {
val person: Person by map
}
40. For example
×Build type-safe APIs on top of unsafe APIs:
SharedPreferences, Bundle, Intent, Cursor
×DI without annotation processing: KOIN,
injekt etc