This document summarizes a presentation on demystifying Scala's type system. It covers key topics like types and variance, type bounds, abstract type members, ad-hoc polymorphism, existential types, and generalized type constraints. The schedule lists these topics to be covered in the presentation.
Router 1X3 – RTL Design and VerificationIJERD Editor
Routing is the process of moving a packet of data from source to destination and enables messages
to pass from one computer to another and eventually reach the target machine. A router is a networking device
that forwards data packets between computer networks. It is connected to two or more data lines from different
networks (as opposed to a network switch, which connects data lines from one single network). This paper,
mainly emphasizes upon the study of router device, it‟s top level architecture, and how various sub-modules of
router i.e. Register, FIFO, FSM and Synchronizer are synthesized, and simulated and finally connected to its top
module.
Router 1X3 – RTL Design and VerificationIJERD Editor
Routing is the process of moving a packet of data from source to destination and enables messages
to pass from one computer to another and eventually reach the target machine. A router is a networking device
that forwards data packets between computer networks. It is connected to two or more data lines from different
networks (as opposed to a network switch, which connects data lines from one single network). This paper,
mainly emphasizes upon the study of router device, it‟s top level architecture, and how various sub-modules of
router i.e. Register, FIFO, FSM and Synchronizer are synthesized, and simulated and finally connected to its top
module.
These slides explain more about types of errors in Data communication, issues of parity check , and redundancy .
also it includes some solutions of questions based on data communication
(intro, classification, signal operation, convolution, time systems, fourier series, sampling, signal reconstruction, laplace, z transform, analog filters)
As the author of an open-source serialization library in Scala, I've undergone a lot of struggle to understand and harness the power of Scala's type system. My library was based on parsing pickled Scala signatures, which was a subterranean and sparely documented feature of Scala 2.8. I wanted to serialize and deserialize options, lists and maps, which required defeating type erasure when serializing while skating by on type erasure when deserializing. I struggled with multiple constructors, checking for annotation types, specialization, more. The new reflection libraries introduced in Scala 2.10 provided easier access to the same information I had been getting from the pickled signatures. This talk will address practical aspects of type mining, providing a library of hands-on examples using the Scala 2.10 reflection API.
A gentle introduction on the use of implicit values & conversions in Scala.
It also introduces some design patterns for which implicit(s) are the building blocks.
http://blog.stratio.com/developers-guide-scala-implicit-values-part/
These slides explain more about types of errors in Data communication, issues of parity check , and redundancy .
also it includes some solutions of questions based on data communication
(intro, classification, signal operation, convolution, time systems, fourier series, sampling, signal reconstruction, laplace, z transform, analog filters)
As the author of an open-source serialization library in Scala, I've undergone a lot of struggle to understand and harness the power of Scala's type system. My library was based on parsing pickled Scala signatures, which was a subterranean and sparely documented feature of Scala 2.8. I wanted to serialize and deserialize options, lists and maps, which required defeating type erasure when serializing while skating by on type erasure when deserializing. I struggled with multiple constructors, checking for annotation types, specialization, more. The new reflection libraries introduced in Scala 2.10 provided easier access to the same information I had been getting from the pickled signatures. This talk will address practical aspects of type mining, providing a library of hands-on examples using the Scala 2.10 reflection API.
A gentle introduction on the use of implicit values & conversions in Scala.
It also introduces some design patterns for which implicit(s) are the building blocks.
http://blog.stratio.com/developers-guide-scala-implicit-values-part/
These are the slides from a talk I gave at the Waterloo Scala Meetup on October 9th 2013. The talk was geared toward describing the purpose of implicits, use cases, and getting past that initial hump of "what are they and why would I need them" in order to get people to start exploring the ideas.
Spring 3.1 and MVC Testing Support - 4DevelopersSam Brannen
Please note that this presentation is an abridged version of the one given by Rossen Stoyanchev and me at SpringOne 2GX 2012.
This session will give attendees an overview of the new testing features in Spring 3.1 as well the new Spring MVC test support. Sam Brannen will demonstrate how to use the Spring TestContext Framework to write integration tests for Java-based Spring configuration using @Configuration classes. He'll then compare and contrast this approach with XML-based configuration and follow up with a discussion of the new testing support for bean definition profiles. Next, attendees will see how testing server-side code with annotated controllers and client-side code with the RestTemplate just got a whole lot easier with the new Spring MVC test support. Come to this session to see these new Spring testing features in action.
Reactive Programming With Akka - Lessons LearnedDaniel Sawano
This presentation was given by Daniel Deogun and Daniel Sawano at the 33rd Degree Conference, Krakow, 2014.
When mentioning Akka, most of us think of a framework allowing one to design high performant, scalable, and fault tolerant systems. But the question is, how can one utilize the power of reactive programming when surrounded by legacy?
In this talk, we will share our insights and experiences from developing high performance systems with Akka. Despite that Akka APIs are more favorable in Scala, we have chosen and successfully used Akka’s Java APIs. A strategy that may have significant impact on the business and the success of a project. In addition, we will present how domain specific requirements influences your design options, the traps we have walked into, and how everyone may benefit from Akka regardless of green or brown field development.
The no-framework Scala Dependency Injection FrameworkAdam Warski
Using a DI framework/container may seem obvious. But when was the last time you considered *why* do you really need one? After all, "dependency injection" is just a fancy name for passing arguments to a constructor. In the talk we'll walk through some of the features of DI containers and see if we can replace them with pure Scala code. We'll start with "manual" DI, followed with using MacWire to generate the wiring code for us. Then we'll proceed to a no-framework scopes implementation (e. g. request or session), which are very useful in web applications. We will also discuss possibilities of adding interceptors using macros. And finally, we'll see how to use traits to create and compose modules (similar to the module concept known from Guice), which can be viewed as a simplified cake pattern. As MacWire heavily uses macros, as a bonus, I'll explain how Scala Macros work and when they can be useful.
Asynchronous IO is one of the most important building blocks when designing high-performance systems. Over the years various patterns emerged on top of the selector based services provided by the operating system. In this talk I will give a quick overview of the most important asynchronous IO patterns from callbacks to iteratees. Finally I will show how these approaches map to the actor world, introducing the new IO model designed by the Akka and Spray team available in Akka 2.2.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...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 the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Key Trends Shaping the Future of Infrastructure.pdf
Demystifying Scala Type System
1. Demystifying Scala
Type System
David Galichet
CTO @ CoachClub
jeudi 29 novembre 12
2. Schedule
Scala Types 101
Types Variance and Type bounds
Abstract Type members
Ad-Hoc Polymorphism
Existential Types
Generalized Type Constraints
jeudi 29 novembre 12
3. What is a type system ?
“A type system is a tractable syntactic method for
proving the absence of certain program behaviors by
classifying phrases according to the kinds of values
they compute.“ – Benjamin Pierce
jeudi 29 novembre 12
4. What is a type ?
A Type defines a set of values a variable can posses and a set
of functions that can be applied to these values
Set of values can be defined as
Cartesian product Types (like case classes or Tuples)
Sum Types (like Either)
Types can be Abstract and/or Polymorph
jeudi 29 novembre 12
5. What is a type ?
In Functional Languages like Scala, a Function is also a Type
that can be assigned to a variable or (higher order) function
or returned by a (higher order) function
jeudi 29 novembre 12
6. Why typing ?
“Make illegal states unrepresentable“ - Yaron Minsky
“Where static typing fits, do it every time because it
has just fantastic maintenance benefits.” - Simon Peyton
Jones
Compiler can use Type informations to optimize compiled
code
jeudi 29 novembre 12
7. Scala Types 101
Scala is Object Oriented and Functional
Scala has a strong and static Type System
Types are checked at compile time
Types can be inferred by the compiler
Functions are Types : A => B
jeudi 29 novembre 12
8. Scala Types 101
Types are used to define
[abstract] classes
objects
traits
jeudi 29 novembre 12
9. Scala Types 101 Any
⟙
Scala types hierarchy AnyVal AnyRef
Enclosed by : Primitive Types
All Types
wrappers
Top type ⟙ (Any)
Bottom type ⟘ (Nothing)
Nothing
⟘
Java Primitive Types are wrapped under AnyVal
(Unit, Long, Double, Boolean ...)
Since 2.10, you can define your own AnyVal
jeudi 29 novembre 12
10. Scala Types 101
Scala Types can be parameterized
List[A]
Either[A, B]
Functions can also take type parameters
def show[A](a:A):String = a.toString
jeudi 29 novembre 12
11. Type Variance and Bounds
Type Variance goal is to define inheritance relation
By default, Type Parameters are invariant
They can also be defined as co-variant or contra-variant
jeudi 29 novembre 12
12. Type Variance and Bounds
Co-Variance(M[+T]) B M[B]
if A extends B then M[A] extends M[B] A M[A]
Contra-Variance (M[-T])
if A extends B then M[B] extends M[A]
B M[A]
A M[B]
jeudi 29 novembre 12
13. Type Variance and Bounds
Some examples of Types with varying type parameters
List[+A]
Writer[-A]
Function1[-T, +R]
jeudi 29 novembre 12
14. Type Variance and Bounds
scala> class Test[+A] {
| def test(a: A): String = a.toString
| }
<console>:8: error: covariant type A occurs in
contravariant position in type A of value a
WTF ?
jeudi 29 novembre 12
15. Type Variance and Bounds
First of all, take a look at Functions :
Function1[-T,+R]
Functions are Co-Variant on return type (+R) and Contra-
Variant on parameters (-T) !
We can substitute Function1[A,D] by
Function1[B,C] : B D Function1[A, D]
⋀
A C Function1[B, C]
jeudi 29 novembre 12
16. Type Variance and Bounds
This is a Function1 instance !
class Test[+A] {
def test(a: A): String = a.toString
}
Type A should be either Invariant or Contra-Variant but it’s
Co-Variant
jeudi 29 novembre 12
17. Type Variance and Bounds
Solution : introduce a bounded Type
class Test[+A] {
def test[B >: A](b: B): String = b.toString
}
Lower Type Bound : this new Type B is a super Type of A
Method test will accept A or any super Type of A
jeudi 29 novembre 12
18. Type Variance and Bounds
Implementation of a List
trait List[+T] {
def ::[U >: T](u: U): List[U] = Cons(u,
this)
}
case class Cons[T](head: T, tail: List[T])
extends List[T]
case object Nil extends List[Nothing]
Inherit from any List[T]
jeudi 29 novembre 12
19. Type Variance and Bounds
Variance is not applicable to mutable state :
trait Mutable[+T] {
var t: T // generate a setter:
// def t_=(t: T) {this.t = t}
}
Co-Variant parameter in Contra-Variant position
⇒ A mutable List can’t be Co-Variant !
jeudi 29 novembre 12
20. Type Variance and Bounds
Implementation of a Writer - Part1
class B { def toString = "I’m B" }
class A extends B { def toString = "I’m A" }
Inherit from any List[T]
trait Writer[-T] { def write(t: T): String }
val bWriter = new Writer[B] { def write(b:
B): String = b.toString }
def write[T](t: T)(w: Writer[T]) = w.write(t)
jeudi 29 novembre 12
21. Type Variance and Bounds
Implementation of a Writer - Part2
write(new B)(bWriter)
res> String = I’m B We need a Writer[A]
write(new A)(bWriter)
res> String = I’m A
B Write[A]
Fortunately, Writer[B] extends Writer[A]:
A Write[B]
jeudi 29 novembre 12
22. Type member
Concrete Types can be defined in a class, trait or object
type Color = String // type Alias
type Valid[X] = Either[Throwable, X]
// Valid is parametrized with X
We can define these types with their kind :
Color or String has kind *
Valid or Option has kind * ➞ *
Either has kind * ➞ * ➞ *
jeudi 29 novembre 12
23. Abstract Type members
We can define Abstract Type in abstract classes or traits
Abstract Types are another way to parameterize Types
trait Food
class Grass extends Food
class Fish extends Food
trait Species {
type SuitableFood <: Food
}
trait Animal extends Species
class Cow extends Animal {
type SuitableFood = Grass
}
jeudi 29 novembre 12
24. Abstract Type members
The parameterized type way :
trait Food
class Grass extends Food
class Fish extends Food
trait Species[T <: Food]
trait Animal[T <: Food] extends Species[T]
class Cow extends Animal[Grass]
jeudi 29 novembre 12
25. Ad-Hoc Polymorphism
Ad-Hoc polymorphism is a way to add behavior to an existing
class without modifying it
In Haskell, polymorphism is achieved using typeclasses
Typeclasses
abs :: (Num a, Ord a) => a -> a
abs x = if x < 0 then -x else x
jeudi 29 novembre 12
26. Ad-Hoc Polymorphism
In Scala, we can achieve Ad-Hoc polymorphism using
implicits
implicits are used in two places
implicit conversion to convert a type to another
implicit parameter
jeudi 29 novembre 12
27. Ad-Hoc Polymorphism
In Scala, we can achieve Ad-Hoc polymorphism using
implicits
Scala library defines many Typeclasses to achieve Ad-Hoc
polymorphism : Integral, Numeric, Ordering ...
def abs[T](x: T)(implicit num: Numeric[T]): T =
if(num.lt(x, num.zero)) num.negate(x) else x
def max[T: Ordering](x: T, y: T): T =
implicitly[Ordering[T]].max(x, y)
jeudi 29 novembre 12
28. Ad-Hoc Polymorphism
We can define our own instances of existing typeclasses
case class Student(name: String, score: Float)
implicit object StudentOrdering extends
Ordering[Student] {
def compare(x: Student, y: Student) =
x.score.compareTo(y.score)
}
scala> max(Student("Bob", 5.6F), Student("Alice",
5.8F))
res0: Student = Student(Alice,5.8)
jeudi 29 novembre 12
29. Ad-Hoc Polymorphism
We can define our own instances of typeclasses
implicit class Printable[A](a: A) { // since Scala
2.10
def printOut(): Unit = println(a.toString)
}
scala> "test".printOut
test
jeudi 29 novembre 12
30. Ad-Hoc Polymorphism
A more concrete example - Part 1
trait Searchable[T] {
val id: String
val indexedContent: String
}
class SearchEngine[T](defaultBuilder: String => T){
def index(searchable: Searchable[T]) { /* ... */ }
def search(query: String)(builder: String => T =
defaultBuilder): T = builder("0")
}
jeudi 29 novembre 12
31. Ad-Hoc Polymorphism
A more concrete example - Part 2
case class Person(id: Long, name: String)
implicit def person2Searchable(p: Person) =
new Searchable[Person] {
val id = p.id.toString
val indexedContent = p.name
}
val fakeEngine = new SearchEngine[Person]( id =>
Person(id.toLong, "retrieved content") )
jeudi 29 novembre 12
33. Existential Types
Existential types are reference to type parameter that is
unknown
The Scala existential type in M[_] is the dual of Java
wildcard M<?>
They can be defined using :
M[T] forSome { type T }
or M[_]
jeudi 29 novembre 12
34. Existential Types
We can bound existential types :
M[T] forSome { type T <: AnyRef }
or M[_ <: AnyRef]
jeudi 29 novembre 12
35. Generalized Type Constraints
Constrain type using an implicit
=:= same type
<:< lower type
>:> super type
jeudi 29 novembre 12
36. Generalized Type Constraints
Example :
trait Food
class Grass extends Food
class Fish extends Food
trait Animal[SuitableFood <: Food] {
def fish(implicit ev: SuitableFood =:= Fish){
println("I'm fishing")
}
}
class Cow extends Animal[Grass]
class Bear extends Animal[Fish]
jeudi 29 novembre 12