Spire is a Scala library for fast, generic, and precise numerics. It allows us to write generic numeric algorithms, provides the ‘number tower’ and offers a lot of utilities you didn’t know you needed.
Numeric programming is a notoriously difficult topic. For number crunching, e.g. solving systems of linear equations, we need raw performance. However, using floating-point numbers may lead to inaccurate results. On top of that, in functional programming, we’d really like to abstract over concrete number types, which is where abstract algebra comes into play. This interplay between abstract and concrete and the fact that everything needs to run on finite hardware is what makes good library support necessary for writing fast & correct programs. Spire is such a library in the Typelevel Scala ecosystem. This talk will be an introduction to Spire, showcasing the ‘number tower’, real-ish numbers and how to obey the law.
Top tools needed for advanced penetration testingShivamSharma909
Penetration testing or pen testing is a method of evaluating security levels that are involved in the system or network. It can also be used to determine the flaws or defects related to hardware and software.
https://www.infosectrain.com/blog/top-tools-needed-for-advanced-penetration-testing/
Top tools needed for advanced penetration testingShivamSharma909
Penetration testing or pen testing is a method of evaluating security levels that are involved in the system or network. It can also be used to determine the flaws or defects related to hardware and software.
https://www.infosectrain.com/blog/top-tools-needed-for-advanced-penetration-testing/
About a year ago, I started feeling overwhelmed with all the changes to front-end development. I understood HTML and CSS, responsive design made sense, but then everybody started grunting and gulping, and frankly I got a little scared. Wasn't Bower the arch-enemy of Mario and Luigi?
Combine that with all the changes to Drupal 8, and it's pretty easy to feel overwhelmed. Everybody else knows what all these new things are, right? I'm the only one in the dark?
What made me most nervous was not even knowing what all these terms mean. Once I had a basic grasp of a concept, it felt a lot less intimidating.
So what I'd like to share with you is a Drupal 8 base theme I'm developing that uses some of these new techniques. I'm not going to explain to you the details of how to implement every single new technique out there, but will try to explain what some of these new tools are without making too many assumptions of what you might know. I will walk you through the structure of a Drupal 8 theme that makes use of new front end techniques, so you can see what does what and get some ideas of what you'd like to learn next.
My goal with this theme is to make use of Brad Frost's atomic design principles: essentially component based design. I'm setting up this theme to integrate with Pattern Lab, a prototyping tool that we'll also set up to work as a living style guide. Styles are managed with Sass and synced with Pattern Lab using Grunt, a task manager. The theme makes use of a number of great Sass tools like Breakpoint and the Susy grid framework. We'll also take a look at the Twig templates new to Drupal 8, as well as some of the other theme files specific to Drupal 8.
I hope that I'll learn from you too. If we have time during Q and A, you can share some modern techniques you'd like to see in a new Drupal theme. There's a good chance I'll be working on the theme during sprints, so if you'd like to help pitch in, I'd be glad for the assistance. This theme will be featured in my upcoming book: Drupal 8 Responsive Web Design.
My goal is for us all to leave the session feeling that while we may have to learn, we have a handle on what front end techniques look interesting and useful to investigate further.
When my session finishes, my goal is for attendees to leave the room more familiar with the files they are likely to see in a Drupal 8 theme, and what each of them does. Similarly, attendees should have a greater familiar with the some of the newer techniques and tools they might encounter in a Drupal 8 base theme.
Massively scalable ETL in real world applications: the hard wayJ On The Beach
Big Data examples always give the correct answers. However, in the real world, Big Data might be corrupt, contradictory or consist of so many small files it becomes extremely hard to keep track - let alone scale. A solid architecture will help to overcome many of the difficulties.
Floris will talk about a real-world implementation of a massively scalable ETL architecture. Two years ago, at the time of the implementation, Airflow just became part of Apache and still left many features to be desired for. However, requirements from the start were thousands of ETL tasks per day on average, but on occasion, this could become hundreds of thousands. The script-based method that was in place was already not capable to meet the requirements on a day to day basis and needed to be replaced as soon as possible. So this custom framework was rolled out in just 8 weeks of development time.
Traditional Big Data is done on Data you have. You load the data into a repository and perform map reduce or other style calculations on the data. However, certain industries need to perform complex operations on data you might not have. Data you can acquire, Data that can be shared with you, and Data that you can model are all types of data you may not have but may need to integrate instantly into a complex data analysis. Problem is: you may not even know you need this data until deep into the execution stack at runtime. This talk discusses a new functional language paradigm for dealing naturally with data you don’t have and about how to make all data first-class citizens, regardless of whether you have it or you don’t, and we will give a demo of a project written in Scala to deal exactly with this issue.
About a year ago, I started feeling overwhelmed with all the changes to front-end development. I understood HTML and CSS, responsive design made sense, but then everybody started grunting and gulping, and frankly I got a little scared. Wasn't Bower the arch-enemy of Mario and Luigi?
Combine that with all the changes to Drupal 8, and it's pretty easy to feel overwhelmed. Everybody else knows what all these new things are, right? I'm the only one in the dark?
What made me most nervous was not even knowing what all these terms mean. Once I had a basic grasp of a concept, it felt a lot less intimidating.
So what I'd like to share with you is a Drupal 8 base theme I'm developing that uses some of these new techniques. I'm not going to explain to you the details of how to implement every single new technique out there, but will try to explain what some of these new tools are without making too many assumptions of what you might know. I will walk you through the structure of a Drupal 8 theme that makes use of new front end techniques, so you can see what does what and get some ideas of what you'd like to learn next.
My goal with this theme is to make use of Brad Frost's atomic design principles: essentially component based design. I'm setting up this theme to integrate with Pattern Lab, a prototyping tool that we'll also set up to work as a living style guide. Styles are managed with Sass and synced with Pattern Lab using Grunt, a task manager. The theme makes use of a number of great Sass tools like Breakpoint and the Susy grid framework. We'll also take a look at the Twig templates new to Drupal 8, as well as some of the other theme files specific to Drupal 8.
I hope that I'll learn from you too. If we have time during Q and A, you can share some modern techniques you'd like to see in a new Drupal theme. There's a good chance I'll be working on the theme during sprints, so if you'd like to help pitch in, I'd be glad for the assistance. This theme will be featured in my upcoming book: Drupal 8 Responsive Web Design.
My goal is for us all to leave the session feeling that while we may have to learn, we have a handle on what front end techniques look interesting and useful to investigate further.
When my session finishes, my goal is for attendees to leave the room more familiar with the files they are likely to see in a Drupal 8 theme, and what each of them does. Similarly, attendees should have a greater familiar with the some of the newer techniques and tools they might encounter in a Drupal 8 base theme.
Massively scalable ETL in real world applications: the hard wayJ On The Beach
Big Data examples always give the correct answers. However, in the real world, Big Data might be corrupt, contradictory or consist of so many small files it becomes extremely hard to keep track - let alone scale. A solid architecture will help to overcome many of the difficulties.
Floris will talk about a real-world implementation of a massively scalable ETL architecture. Two years ago, at the time of the implementation, Airflow just became part of Apache and still left many features to be desired for. However, requirements from the start were thousands of ETL tasks per day on average, but on occasion, this could become hundreds of thousands. The script-based method that was in place was already not capable to meet the requirements on a day to day basis and needed to be replaced as soon as possible. So this custom framework was rolled out in just 8 weeks of development time.
Traditional Big Data is done on Data you have. You load the data into a repository and perform map reduce or other style calculations on the data. However, certain industries need to perform complex operations on data you might not have. Data you can acquire, Data that can be shared with you, and Data that you can model are all types of data you may not have but may need to integrate instantly into a complex data analysis. Problem is: you may not even know you need this data until deep into the execution stack at runtime. This talk discusses a new functional language paradigm for dealing naturally with data you don’t have and about how to make all data first-class citizens, regardless of whether you have it or you don’t, and we will give a demo of a project written in Scala to deal exactly with this issue.
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...J On The Beach
Industry 4.0, aka the "Fourth Industrial Revolution," refers to the computerization of manufacturing. One important aspect of Industry 4.0 is the ability to monitor the health and reliability of a physical manufacturing plant using low-cost IoT sensors. For example, machine learning models can be trained to predict the physical degradation of a manufacturing system as a function of acoustic measurements obtained from strategically placed microphones; however, the same acoustic measurements can be used to reverse engineer proprietary information about the manufacturing process and/or precisely what is being manufactured at the time of recording. Thus, improved reliability and fault tolerance is achieved at the cost of what appears to be an unprecedented new class of security vulnerabilities related to the acoustic side channel.
As a case study, we report a novel acoustic side channel attack against a commercial DNA synthesizer, a commonly used instrument in fields such as synthetic biology. Using a smart phone-quality microphone placed on or in the near vicinity of a DNA synthesizer, we were able to determine with 88.07% accuracy the sequence of DNA being produced; using a database of biologically relevant known-sequences, we increased the accuracy of our model to 100%. An academic or industrial research project may use the synthetic DNA to engineer an organism with desired traits or functions; however, while the organism is still under development, prior to publication, patent, and/or copyright, the research remains vulnerable to academic intellectual property theft and/or industrial espionage. On the other hand, this attack could also be used for benevolent purposes, for example, to determine whether a suspected criminal or terrorist is engineering a harmful pathogen. Thus, it is essential to recognize both the benefits and risks inherent to the cyber-physical systems that will inevitably control Industry 4.0 manufacturing processes and to take steps to mitigate them whenever possible.
Where is the edge in IoT and how much can you do there? Data collection? Analytics? I’ll show you how to build and deploy an embedded IoT edge platform that can do data collection, analytics, dashboarding and much more. All using Open Source.
As IoT deployments move forward, the need to collect, analyze, and respond to data further out on the edge becomes a critical factor in the success – or failure – of any IoT project. Network bandwidth costs may be dropping, and storage is cheaper than ever, but at IoT scale, these costs can still quickly overrun a project’s budget and ultimately doom it to failure.
The more you centralize your data collection and storage, the higher these costs become. Edge data collection and analysis can dramatically lower these costs, plus decrease the time to react to critical sensor data. With most data platforms, it simply isn’t practical, or even possible, to push collection AND analytics to the edge. In this talk I’ll show how I’ve done exactly this with a combination of open source hardware – Pine64 – and open source software – InfluxDB – to build a practical, efficient and scalable data collection and analysis gateway device for IoT deployments. The edge is where the data is, so the edge is where the data collection and analytics needs to be.
Drinking from the firehose, with virtual streams and virtual actorsJ On The Beach
Event Stream Processing is a popular paradigm for building robust and performant systems in many different domains, from IoT to fraud detection to high-frequency trading. Because of the wide range of scenarios and requirements, it is difficult to conceptualize a unified programming model that would be equally applicable to all of them. Another tough challenge is how to build streaming systems with cardinalities of topics ranging from hundreds to billions while delivering good performance and scalability.
In this session, Sergey Bykov will talk about the journey of building Orleans Streams that originated in gaming and monitoring scenarios, and quickly expanded beyond them. He will cover the programming model of virtual streams that emerged as a natural extension of the virtual actor model of Orleans, the architecture of the underlying runtime system, the compromises and hard choices made in the process. Sergey will share the lessons learned from the experience of running the system in production, and future ideas and opportunities that remain to be explored.
Over the last twenty years, there has been a paradigm shift in software development: from meticulously planned release cycles to an experimental way of working in which lead times are becoming shorter and shorter.
How can Java ever keep up with this trend when we have Docker containers that are several hundred megabytes in size, with warm-up times of ten minutes or longer? In this talk, I'll demonstrate how we can use Quarkus so that we can create super small, super fast Java containers! This will give us better possibilities for scaling up and down - which can be a game-changer, especially in a serverless environment. It will also provide the shortest possible lead times, as well as a much better use of cloud performance with the added bonus of lower costs.
When Cloud Native meets the Financial SectorJ On The Beach
We live in our own bubble of microservices and endlessly horizontal scaling infrastructure, but there is still critical infrastructure that runs the world of financial systems depending on Windows boxes, FTP servers, and single-threaded protocols. This talk is about how to glue these two worlds together, what works for us and what doesn't.
The advancement of technology in the last decade or so has allowed astronomy to see exponential growth in data volumes. ESA's space telescope Euclid will gather high-resolution images of a third of the sky, ~850GB of data downloaded daily for 6 years, by 2032 ground-based telescope LSST will have generated 500PB of data and the radio telescope SKA will be producing more data per second than the entire internet worldwide. This talk will address the questions of what current techniques exist to address big data volumes, how the astronomical community will prepare for this big data wave, and what other challenges lie ahead?
The world is moving from a model where data sits at rest, waiting for people to make requests of it, to where data is constantly moving and streams of data flow to and from devices with or without human interaction. Decisions need to be made based on these streams of data in real-time, models need to be updated, and intelligence needs to be gathered. In this context, our old-fashioned approach of CRUD REST APIs serving CRUD database calls just doesn't cut it. It's time we moved to a stream-centric view of the world.
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...J On The Beach
Our increasingly connected world leveraging the Internet of Things (IoT) creates great value, in connected healthcare, smart cities, and more. The increasing use of IoT also creates great risk. We will discuss the challenges and risks we need to address as developers in TIPPSS - Trust, Identity, Privacy, Protection, Safety, and Security - for devices, systems and solutions we deliver and use. Florence leads IEEE workstreams on clinical IoT and data interoperability with blockchain addressing TIPPSS issues. She is an author of IEEE articles on "Enabling Trust and Security - TIPPSS for IoT" and "Wearables and Medical Interoperability - the Evolving Frontier", "TIPPSS for Smart Cities" in the 2017 book "Creating, Analysing and Sustaining Smarter Cities: A Systems Perspective" , and Editor in Chief for an upcoming book on "Women Securing the Future with TIPPSS for IoT."
Pushing AI to the Client with WebAssembly and BlazorJ On The Beach
Want to run your AI algorithms directly in the browser on the client-side? Now you can with WebAssembly and Blazor. Join us as we write code directly in WebAssembly. Then, we’ll look at Blazor and how you can use it, along with WebAssembly to run your tooling client side in the browser.
Want to run your AI algorithms directly in the browser on the client-side without the need for transpilers or browser plug-ins? Well, now you can with WebAssembly and Blazor. WebAssembly (WASM) is the W3C specification that will be used to provide the next generation of development tools for the web and beyond. Blazor is Microsoft’s experiment that allows ASP.Net developers to create web pages that do much of the scripting work in C# using WASM. Come join us as we learn to write code directly in WebAssembly’s human-readable format. Then, we’ll look at the current state of Blazor and how you can use it, along with WebAssembly to run your tooling client side in the browser.
RAFT protocol is a well-known protocol for consensus in Distributed Systems. Want to learn how consensus is achieved in a system with a large amount of data such as Axon Server’s Event Store? Join this talk to hear about all specifics regarding data replication in highly available Event Store!
Axon is a free and open source Java framework for writing Java applications following DDD, event sourcing, and CQRS principles. While especially useful in a microservices context, Axon provides great value in building structured monoliths that can be broken down into microservices when needed.
Axon Server is a messaging platform specifically built to support distributed Axon applications. One of its key benefits is storing events published by Axon applications. In not so rare cases, the number of these events is over millions, even billions. Availability of Axon Server plays a significant role in the product portfolio. To keep event replication reliable we chose RAFT protocol for consensus implementation of our clustering features.
In short, consensus involves multiple servers agreeing on values. Once they reach a decision on a value, that decision is final. Typical consensus algorithms make progress when any majority of their servers is available; for example, a cluster of 5 servers can continue to operate even if 2 servers fail. If more servers fail, they stop making progress (but will never return an incorrect result).
Join this talk to learn why we chose RAFT; what were our findings during the design, the implementation, and testing phase; and what does it mean to replicate an event store holding billions of events!
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...J On The Beach
Thinking of moving to Microservices? Watch out! That quest is full of traps, social traps. If you are not able to handle it, you may be blocked by meetings, frustration, endless challenges that will make you miss the monolith. In this talk, I share my experience and mistakes, so you can avoid them.
Creating or migrating to a Microservices architecture might easily become a big mess, not only due to technical challenges but mostly because of human factors: it’s a major change in the software culture of a company. In this talk, I’ll share my past experience as the technical lead of an ambitious Microservices-based product, I’ll go through the parts we struggled with, and give you some advice on how to deal with what I call the Six Pitfalls:
The Common Patterns Phobia
The Book Club Cult
The Never-Decoupled Story
The Buzz Words Syndrome
The Agile Trap
The Conway’s Law Hackers
Instead of randomly injecting faults ( i.e. Chaos Monkey), what if we could order our experiments to perform min number of experiments for maximum yield? We present a solution(& results) to the problem of experiment selection using Lineage Driven Fault Injection to reduce the search space of faults.
Lineage Driven Fault Injection (LDFI) is a state of the art technique in chaos engineering experiment selection. LDFI since its inception has used an SAT solver under the hood which presents solutions to the decision problem (which faults to inject) in no particular order. As SRE’s we would like to perform experiments that reveal the bugs that the customers are most likely to hit first. In this talk, we present new improvements to LDFI that orders the experiment suggestions.
In the first the half of the talk we will show LDFI is a technique that can be widely used within an enterprise. We present the motivation for ordering the chaos experiments along with some prioritization we utilized while conducting the experiments. We also highlight how ordering is a general purpose technique that we can use to encode the peculiarities of a heterogeneous microservices architecture. LDFI can work in an enterprise by harnessing the observability infrastructure to model the redundancy of the system.
Next, we present experiments conducted within our organization using ordered LDFI and some preliminary results. We show examples of services where we discovered bugs, and how carefully controlling the order of experiments allowed LDFI to avoid running unnecessary experiments. We also present an example of an application where we declared the service shippable under crash stop model. We also present a comparison with Chaos Monkey and show how LDFI found the known bugs in a given application using orders of magnitude fewer experiments than a random fault injection tool like Chaos Monkey.
Finally, we discuss how we plan to take LDFI forward. We discuss open problems and possible solutions for scalarizing probabilities of failure, latency injection, integration with service mesh technologies like envoy for fine-grained fault injection, fault injection for stateful systems.
Key takeaways: 1) Understand how LDFI can be integrated in the enterprise by harnessing the observability infrastructure. 2) Limitations of LDFI w.r.t unordered solutions and why ordering matters for chaos engineering experiments. 3) Preliminary results of prioritized LDFI and a future direction for the community.
Complexity in systems should be defeated if it is possible to do. But the default nature of our computer systems are complex and servers are doomed to fail. In this talk, we will go through new approaches in modern architectures to design and evaluate new computer systems.
Interaction Protocols: It's all about good mannersJ On The Beach
Distributed systems collaborate to achieve collective goals via a system of rules. Rules that affords good hygiene, fault tolerance, effective communication and trusted feedback. These rules form protocols which enable the system to achieve its goals.
Distributed and concurrent systems can be considered a social group that collaborates to achieve collective goals. In order to collaborate a system of rules must be applied, that affords good hygiene, fault tolerance, and effective communication to coordinate, share knowledge, and provide feedback in a polite trusted manner. These rules form a number of protocols which enable the group to act as a system which is greater than the sum of the individual components.
In this talk, we will explore the history of protocols and their application when building distributed systems.
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...J On The Beach
Do you want to check the efficiency of the new, state of the art, GraalVM JIT Compiler in comparison to the old but mostly used JIT C2? Let’s have a side by side comparison from a performance standpoint on the same source code.
The talk reveals how traditional Just In Time Compiler (e.g. JIT C2) from HotSpot/OpenJDK internally manages runtime optimizations for hot methods in comparison to the new, state of the art, GraalVM JIT Compiler on the same source code, emphasizing all of the internals and strategies used by each Compiler to achieve better performance in most common situations (or code patterns). For each optimization, there is Java source code and corresponding generated assembly code in order to prove what really happens under the hood.
Each test is covered by a dedicated benchmark (JMH), timings and conclusions. Main topics of the agenda: - Scalar replacement - Null Checks - Virtual calls - Lock coarsening - Lock elision - Virtual calls - Scalar replacement - Lambdas - Vectorization (few cases)
The tools used during my research study are JITWatch, Java Measurement Harness, and perf. All test scenarios will be launched against the latest official Java release (e.g. version 11).
Leadership is easy when you're a manager, or an expert in a field, or a conference speaker! In a Kanban organisation, though, we "encourage acts of leadership at every level". In this talk, we look at what it means to be a leader in the uncertain, changing and high-learning environment of software development. We learn about the importance of safety in encouraging others to lead and follow, and how to get that safety using both technical and human practices; the necessity of a clear, compelling vision and provision of information on how we're achieving it; and the need to be able to ask awkward and difficult questions... especially the ones without easy answers.
Machine Learning: The Bare Math Behind LibrariesJ On The Beach
During this presentation, we will answer how much you’ll need to invest in a superhero costume to be as popular as Superman. We will generate a unique logo which will stand against the ever popular Batman and create new superhero teams. We shall achieve it using linear regression and neural networks.
Machine learning is one of the hottest buzzwords in technology today as well as one of the most innovative fields in computer science – yet people use libraries as black boxes without basic knowledge of the field. In this session, we will strip them to bare math, so next time you use a machine learning library, you’ll have a deeper understanding of what lies underneath.
During this session, we will first provide a short history of machine learning and an overview of two basic teaching techniques: supervised and unsupervised learning.
We will start by defining what machine learning is and equip you with an intuition of how it works. We will then explain the gradient descent algorithm with the use of simple linear regression to give you an even deeper understanding of this learning method. Then we will project it to supervised neural networks training.
Within unsupervised learning, you will become familiar with Hebb’s learning and learning with concurrency (winner takes all and winner takes most algorithms). We will use Octave for examples in this session; however, you can use your favourite technology to implement presented ideas.
Our aim is to show the mathematical basics of neural networks for those who want to start using machine learning in their day-to-day work or use it already but find it difficult to understand the underlying processes. After viewing our presentation, you should find it easier to select parameters for your networks and feel more confident in your selection of network type, as well as be encouraged to dive into more complex and powerful deep learning methods.
1. N u m e r i c
P r o g r a m m i n g
w i t h S p i r e
L a r s H u p e l
J o n t h e B e a c h
2 0 1 9 - 0 5 - 1 6
2. N u m e r i c
P r o g r a m m i n g
w i t h C a t s ,
A l g e b r a & S p i r e
L a r s H u p e l
J o n t h e B e a c h
2 0 1 9 - 0 5 - 1 6
3. W h a t i s S p i r e ?
“ S p i r e i s a n u m e r i c l i b r a r y f o r S c a l a w h i c h i s i n t e n d e d t o b e g e n e r i c ,
f a s t , a n d p r e c i s e .
”
4. W h a t i s S p i r e ?
“ S p i r e i s a n u m e r i c l i b r a r y f o r S c a l a w h i c h i s i n t e n d e d t o b e g e n e r i c ,
f a s t , a n d p r e c i s e .
”
• i n i t i a l w o r k b y E i r í k r Å s h e i m & T o m S w i t z e r
• s t a r t e d o u t i n 2 0 1 1 a s a S c a l a s t a n d a r d s p r o p o s a l
• 6 0 c o n t r i b u t o r s
5.
6. W h a t ’s i n S p i r e ?
• a l g e b r a i c t o w e r
• n u m b e r t y p e s
• n u m e r i c a l g o r i t h m s
• p r e t t y s y n t a x
• o p t i m i z a t i o n m a c r o s
• l a w s
7. P r o j e c t r e l a t i o n s h i p
D i s c i p l i n e
C a t s K e r n e l
A l g e b r a C a t s
S p i r e A l g e b i r d
8. P r o j e c t r e l a t i o n s h i p
D i s c i p l i n e
C a t s K e r n e l
A l g e b r a C a t s
S p i r e A l g e b i r d
9. A l g e b r a
“ A l g e b r a i s t h e s t u d y o f m a t h e m a t i c a l s y m b o l s a n d t h e r u l e s f o r
m a n i p u l a t i n g t h e s e s y m b o l s .
”
10. A l g e b r a
“ A l g e b r a i s t h e s t u d y o f m a t h e m a t i c a l s y m b o l s a n d t h e r u l e s f o r
m a n i p u l a t i n g t h e s e s y m b o l s .
”
M a t h e m a t i c i a n s s t u d y a l g e b r a t o d i s c o v e r c o m m o n p r o p e r t i e s o f v a r i o u s
c o n c r e t e s t r u c t u r e s .
11. A l g e b r a
“ A l g e b r a i s t h e s t u d y o f m a t h e m a t i c a l s y m b o l s a n d t h e r u l e s f o r
m a n i p u l a t i n g t h e s e s y m b o l s .
”
E x a m p l e s
• n u m b e r s , a d d i t i o n , m u l t i p l i c a t i o n
• m a t r i c e s , v e c t o r s p a c e s , l i n e a r a l g e b r a
• l a t t i c e s , b o o l e a n a l g e b r a
12. A l g e b r a
“ A l g e b r a i s t h e s t u d y o f m a t h e m a t i c a l s y m b o l s a n d t h e r u l e s f o r
m a n i p u l a t i n g t h e s e s y m b o l s .
”
E x a m p l e s
• n u m b e r s , a d d i t i o n , m u l t i p l i c a t i o n
• m a t r i c e s , v e c t o r s p a c e s , l i n e a r a l g e b r a
• l a t t i c e s , b o o l e a n a l g e b r a
13. A l g e b r a
“ A l g e b r a i s t h e s t u d y o f m a t h e m a t i c a l s y m b o l s a n d t h e r u l e s f o r
m a n i p u l a t i n g t h e s e s y m b o l s .
”
E x a m p l e s
• n u m b e r s , a d d i t i o n , m u l t i p l i c a t i o n
• m a t r i c e s , v e c t o r s p a c e s , l i n e a r a l g e b r a
• l a t t i c e s , b o o l e a n a l g e b r a
14. S e m i g r o u p
t r a i t S e m i g r o u p [ A ] {
d e f a p p e n d ( x : A , y : A ) : A
}
15. S e m i g r o u p
t r a i t S e m i g r o u p [ A ] {
d e f a p p e n d ( x : A , y : A ) : A
}
L a w : A s s o c i a t i v i t y
a p p e n d ( x , a p p e n d ( y , z ) ) = = a p p e n d ( a p p e n d ( x , y ) , z )
16. M o n o i d s
t r a i t M o n o i d [ A ] e x t e n d s S e m i g r o u p [ A ] {
d e f a p p e n d ( x : A , y : A ) : A / / S e m i g r o u p
d e f z e r o : A
}
L a w : N e u t r a l e l e m e n t
a p p e n d ( x , z e r o ) = = x
17. M o n o i d a l s t r u c t u r e s
L o t s o f t h i n g s a r e m o n o i d s .
20. M o n o i d a l s t r u c t u r e s
L o t s o f t h i n g s a r e m o n o i d s .
• ( T r a i n , n o t r a i n , c o u p l e )
• ( I n t , 0 , + )
• ( L i s t [ T ] , N i l , c o n c a t )
• ( M a p [ K , V ] , M a p . e m p t y , m e r g e )
22. M o n o i d a l s t r u c t u r e s
L o t s o f t h i n g s a r e m o n o i d s .
• ( T r a i n , n o t r a i n , c o u p l e )
• ( I n t , 0 , + )
• ( L i s t [ T ] , N i l , c o n c a t )
• ( M a p [ K , V ] , M a p . e m p t y , m e r g e )
B u t s o m e a r e n o t !
• ( F l o a t , 0 , + )
24. S e m i g r o u p
M o n o i d
G r o u p
A d d S e m i g r o u p
A d d M o n o i d
A d d G r o u p
( T , 0 , + )
25. S e m i g r o u p
M o n o i d
G r o u p
A d d S e m i g r o u p
A d d M o n o i d
A d d G r o u p
( T , 0 , + )
M u l S e m i g r o u p
M u l M o n o i d
M u l G r o u p
( T , 1 , ·)
26. A d d S e m i g r o u p
A d d M o n o i d
A d d G r o u p
( T , 0 , + )
M u l S e m i g r o u p
M u l M o n o i d
M u l G r o u p
( T , 1 , ·)
S e m i r i n g
( T , + , ·, 0 , 1 )
27. A d d S e m i g r o u p
A d d M o n o i d
A d d G r o u p
( T , 0 , + )
M u l S e m i g r o u p
M u l M o n o i d
M u l G r o u p
( T , 1 , ·)
S e m i r i n g
( T , + , ·, 0 , 1 )
A d d A b G r o u p M u l A b G r o u p
R i g
R n g R i n g
F i e l d
28. L a w C h e c k i n g
/ / F l o a t a n d D o u b l e f a i l t h e s e t e s t s
c h e c k A l l ( " I n t " , R i n g L a w s [ I n t ] . e u c l i d e a n R i n g )
c h e c k A l l ( " L o n g " , R i n g L a w s [ L o n g ] . e u c l i d e a n R i n g )
c h e c k A l l ( " B i g I n t " , R i n g L a w s [ B i g I n t ] . e u c l i d e a n R i n g )
c h e c k A l l ( " R a t i o n a l " , R i n g L a w s [ R a t i o n a l ] . f i e l d )
c h e c k A l l ( " R e a l " , R i n g L a w s [ R e a l ] . f i e l d )
30. N u m b e r s
• m a c h i n e f l o a t s a r e f a s t , b u t i m p r e c i s e
• g o o d t r a d e o f f f o r m a n y p u r p o s e s , b u t n o t a l l !
• t h e r e i s n o “ o n e s i z e f i t s a l l ” n u m b e r t y p e
31. R a t i o n a l n u m b e r s
n
d
∈ Q w h e r e n , d ∈ Z
P r o p e r t i e s
• c l o s e d u n d e r a d d i t i o n , m u l t i p l i c a t i o n , . . .
• d e c i d a b l e c o m p a r i s o n
32. R a t i o n a l n u m b e r s
n
d
∈ Q w h e r e n , d ∈ Z
P r o p e r t i e s
• c l o s e d u n d e r a d d i t i o n , m u l t i p l i c a t i o n , . . .
• d e c i d a b l e c o m p a r i s o n
• m a y g r o w l a r g e
34. R e a l n u m b e r s
W e c a n ’ t r e p r e s e n t a l l r e a l n u m b e r s o n a c o m p u t e r . . .
35. R e a l n u m b e r s
W e c a n ’ t r e p r e s e n t a l l r e a l n u m b e r s o n a c o m p u t e r . . .
. . . b u t w e c a n g e t a r b i t r a r i l y c l o s e
36. R e a l n u m b e r s
W e c a n ’ t r e p r e s e n t a l l r e a l n u m b e r s o n a c o m p u t e r . . .
. . . b u t w e c a n g e t a r b i t r a r i l y c l o s e
37. R e a l n u m b e r s , a p p r o x i m a t e d
t r a i t R e a l {
d e f a p p r o x i m a t e ( p r e c i s i o n : I n t ) : R a t i o n a l
}
38. R e a l n u m b e r s , a p p r o x i m a t e d
t r a i t R e a l { s e l f = >
d e f a p p r o x i m a t e ( p r e c i s i o n : I n t ) : R a t i o n a l
d e f + ( t h a t : R e a l ) : R e a l = n e w R e a l {
d e f a p p r o x i m a t e ( p r e c i s i o n : I n t ) = {
v a l r 1 = s e l f . a p p r o x i m a t e ( p r e c i s i o n + 2 )
v a l r 2 = t h a t . a p p r o x i m a t e ( p r e c i s i o n + 2 )
r 1 + r 2
}
}
}
39. R e a l n u m b e r s , a p p r o x i m a t e d
t r a i t R e a l {
d e f a p p r o x i m a t e ( p r e c i s i o n : I n t ) : R a t i o n a l
}
o b j e c t R e a l {
d e f a p p l y ( f : I n t = > R a t i o n a l ) = / / . . .
d e f f r o m R a t i o n a l ( r a t : R a t i o n a l ) =
a p p l y ( _ = > r a t )
}
40. I r r a t i o n a l n u m b e r s
v a l p i : R e a l =
R e a l ( 1 6 ) * a t a n ( R e a l ( R a t i o n a l ( 1 , 5 ) ) ) -
R e a l ( 4 ) * a t a n ( R e a l ( R a t i o n a l ( 1 , 2 3 9 ) ) )
42. E r r o r b o u n d s
• o f t e n , i n p u t s a r e n o t a c c u r a t e
• e . g . m e a s u r e m e n t s ( t e m p e r a t u r e , w o r k , t i m e , . . . )
• W h a t t o d o w i t h e r r o r b o u n d s ?
43. I n t e r v a l a r i t h m e t i c
c a s e c l a s s I n t e r v a l [ A ] ( l o w e r : A , u p p e r : A )
44. I n t e r v a l a r i t h m e t i c
c a s e c l a s s I n t e r v a l [ A ] ( l o w e r : A , u p p e r : A ) {
d e f + ( t h a t : I n t e r v a l [ A ] ) =
I n t e r v a l ( t h i s . l o w e r + t h a t . l o w e r ,
t h i s . u p p e r + t h a t . u p p e r )
}
45. I n t e r v a l a r i t h m e t i c
c a s e c l a s s I n t e r v a l [ A ] ( l o w e r : A , u p p e r : A ) {
d e f + ( t h a t : I n t e r v a l [ A ] ) =
I n t e r v a l ( t h i s . l o w e r + t h a t . l o w e r ,
t h i s . u p p e r + t h a t . u p p e r )
}
S p i r e g e n e r a l i z e s t h i s e v e n f u r t h e r :
• o p e n / c l o s e d i n t e r v a l s
• b o u n d e d / u n b o u n d e d i n t e r v a l s
47. W h a t e l s e ?
S p i r e i s f u l l o f t o o l s y o u d i d n ’ t k n o w y o u n e e d e d .
48. W h a t e l s e ?
S p i r e i s f u l l o f t o o l s y o u d i d n ’ t k n o w y o u n e e d e d .
• S a f e L o n g : l i k e B i g I n t , b u t f a s t e r
49. W h a t e l s e ?
S p i r e i s f u l l o f t o o l s y o u d i d n ’ t k n o w y o u n e e d e d .
• S a f e L o n g : l i k e B i g I n t , b u t f a s t e r
• T r i l e a n : t r i - s t a t e b o o l e a n v a l u e
50. W h a t e l s e ?
S p i r e i s f u l l o f t o o l s y o u d i d n ’ t k n o w y o u n e e d e d .
• S a f e L o n g : l i k e B i g I n t , b u t f a s t e r
• T r i l e a n : t r i - s t a t e b o o l e a n v a l u e
• U B y t e , U S h o r t , U I n t , U L o n g : u n s i g n e d m a c h i n e w o r d s
51. W h a t e l s e ?
S p i r e i s f u l l o f t o o l s y o u d i d n ’ t k n o w y o u n e e d e d .
• S a f e L o n g : l i k e B i g I n t , b u t f a s t e r
• T r i l e a n : t r i - s t a t e b o o l e a n v a l u e
• U B y t e , U S h o r t , U I n t , U L o n g : u n s i g n e d m a c h i n e w o r d s
• N a t u r a l : n o n - n e g a t i v e , a r b i t r a r y - s i z e d i n t e g e r s
52. Q & A
L a r s H u p e l
l a r s . h u p e l @ i n n o q . c o m
@ l a r s r _ h
w w w . i n n o q . c o m
i n n o Q D e u t s c h l a n d G m b H
K r i s c h e r s t r . 1 0 0
4 0 7 8 9 M o n h e i m a . R h .
G e r m a n y
+ 4 9 2 1 7 3 3 3 6 6 - 0
O h l a u e r S t r . 4 3
1 0 9 9 9 B e r l i n
G e r m a n y
L u d w i g s t r . 1 8 0 E
6 3 0 6 7 O f f e n b a c h
G e r m a n y
K r e u z s t r . 1 6
8 0 3 3 1 M ü n c h e n
G e r m a n y
c / o W e W o r k
H e r m a n n s t r a s s e 1 3
2 0 0 9 5 H a m b u r g
G e r m a n y
i n n o Q S c h w e i z G m b H
G e w e r b e s t r . 1 1
C H - 6 3 3 0 C h a m
S w i t z e r l a n d
+ 4 1 4 1 7 4 3 0 1 1 1
A l b u l a s t r . 5 5
8 0 4 8 Z ü r i c h
S w i t z e r l a n d
53. L A R S H U P E L
C o n s u l t a n t
i n n o Q D e u t s c h l a n d G m b H
L a r s e n j o y s p r o g r a m m i n g i n a v a r i e t y o f l a n -
g u a g e s , i n c l u d i n g S c a l a , H a s k e l l , a n d R u s t . H e i s
k n o w n a s a f r e q u e n t c o n f e r e n c e s p e a k e r a n d o n e
o f t h e f o u n d e r s o f t h e T y p e l e v e l i n i t i a t i v e w h i c h
i s d e d i c a t e d t o p r o v i d i n g p r i n c i p l e d , t y p e - d r i v e n
S c a l a l i b r a r i e s .
54. I m a g e s o u r c e s
• R u b i k ’s C u b e : h t t p s : / / e n . w i k i p e d i a . o r g / w i k i / F i l e : R u b i k % 2 7 s _ C u b e _ v a r i a n t s . j p g , H e l l b u s
• K n o t s : h t t p s : / / e n . w i k i p e d i a . o r g / w i k i / F i l e : T a b e l a _ d e _ n % C 3 % B 3 s _ m a t e m % C 3 % A 1 t i c o s _ 0 1 , _ c r o p . j p g ,
R o d r i g o . A r g e n t o n
• I n t e r v a l s : h t t p s : / / c o m m o n s . w i k i m e d i a . o r g / w i k i / F i l e : C o n f i d e n c e i n t e r v a l . p n g , A u d r i u s M e s k a u s k a s
• N u m b e r v e n n d i a g r a m : h t t p : / / w w w . s c i e n c e 4 a l l . o r g / a r t i c l e / n u m b e r s - a n d - c o n s t r u c t i b i l i t y / , L ê
N g u y ê n H o a n g
• M a r b e l l a : h t t p s : / / p i x a b a y . c o m / p h o t o s / p o r t - m a r b e l l a - a n d a l u s i a - 2 7 0 7 9 9 5 /
• D r a w i n g s : Y i f a n X i n g