Haskell is the world's finest imperative programming language." The above quote comes from Simon P Jones, the creator of Haskell. To newcomers to Functional programming, this may seem weird and mystifying. After all, Haskell is usually known for its advanced Functional programming features such as purity and strong static typing. While it's likely that Simon said this at least partly in jest, the fact is that those same features also make imperative programming in Haskell much more flexible and powerful than in most other languages!
In this talk, we present a view of Haskell and strongly typed functional programming from the "other side" of the prism. We discuss how you can build and compose powerful imperative abstractions with Haskell using the same FP toolset. We discuss how to write common imperative algorithms in Haskell while exploiting advanced features like first-class computations, laziness, and strong static typing. We will also touch upon interfacing with external imperative systems (such as databases, and network communication). At the end of the talk, participants should have enough groundwork to explore Haskell as a *practical* language, and have a greater appreciation of the powerful features offered by Functional Programming.
UI Dev in Big data world using open sourceTech Triveni
He will be sharing his last 10 years of experience in UI Development for Big Data Analytics & ML world using available open-source plethora in the market. How 'UI dev' needs to target big data problems?
Key points to consider while choosing any open-source framework/library for the big data world.
Do you need to write a custom framework or use ready-made open source, when what to choose?
How dev can leverage open source frameworks like Angular, REACT to making big data apps faster?
How you can extend open-source BI tools like Kibana, superset graphana to make UI development tool?
How to show network big data using open source graph libraries?
How to deal with real-time data in Big data UI?
Why use & contribute to open source?
Design UI for future as in Big data world customer problems keep changing with time. Showcasing demo for our real customer's problems, how we achieved using these open source libraries.
Why should a Java programmer shifts towards Functional Programming ParadigmTech Triveni
Functional programming, a buzz word these days. Everyone is trying to learn it. A few functional programming languages are getting attraction and are getting used in the production too such as Scala, Haskell, Clojure and so on. And Even Java has already introduced a few concepts to support functional programming which are Lambdas, Functional Interfaces, Streams, etc. Now the question comes, why should a Java programmer needs to shift towards functional programming.
Java has a very big community and using imperative programming from the last 2 decades. It needs a very solid reason to shift towards the functional programming paradigm. The functional programming paradigm focuses on some key concepts like immutability, higher-order functions and so on and it has a moderate learning curve, but if we can get benefit out of it, then there is no harm in learning functional.
In this talk we will see, what are the benefits we get when we follow the functional programming paradigm in Java, how it makes the developer life easy. We will discuss the comparison between the imperative code vs functional code with some examples.
We will discuss the transition from imperative coding to functional coding with some code examples. This talk will be good for the people who really want to switch to functional programming and want to know how to use that in Java.
Reactive stack paints a very rosy picture of the way to develop the scalable applications focusing on the 4 fundamental things that are responsive, elastic, resilient and asynchronous communication. The principles are pretty simple but there are a lot of pitfalls that nobody talks about.
The challenges are numerous to build the system in the right way and in this talk we will focus on what are these pitfalls and how can we avoid them. We will be exploring the myth that once you adapt to it the journey will be smooth and show how these distributed systems add to additional complexity but can be managed by making smart decisions. I will share our experience of building Reactive Applications and how we have overcome the difficulties that we encounter.
Reactive programming is a new concept that is catching everyone’s eyes these days. The concept has been adopted by the various aspects of software engineering be it application development or DevOps. Our software development languages are also not untouched from it.
So, how can JAVA which has such a large community refrain itself from going reactive? The foundational topics for this talk will revolve around the ideas of reactive programming and what steps JAVA has taken towards being reactive. This would involve the latest buzz words in the market: Reactive streams, Reactive stream specification, the concept of mono and flux. We will also be touching how spring has used these features of reactive streams to make a new API development framework: Spring Boot Webflux. We hope the talk will help to understand Reactive programming aspects of JAVA and it will not bewilder the users as now they know that it’s a coding style that centres on the effective management of changes with async data streams.
Tackling Asynchrony with Kotlin CoroutinesTech Triveni
Reactive Programming is an approach to asynchronous programming. Like every other tool, reactive programming tools like RxJava or Reactor come with their own challenges. Kotlin Coroutines alleviates many of these challenges. Kotlin Coroutines, when being designed, had the advantage of being able to explore existing code that uses reactive stream.
This talk will highlight some of these practical challenges and show how Kotlin Coroutines tackle them. The challenges that will be covered are changes in interface design, programming paradigm shift, reactive type selection, exception handling, cancellation, resource leakage, and sequential vs concurrent.
Programmatic Ad Tracking: Let the power of Reactive Microservices do talkingTech Triveni
We at MiQ bid for billions of impressions every day. This comes at a cost and many technical challenges. After the ad is served we need a mechanism to share insights with clients. We need an application to gather these insights on a periodic basis.
Building microservices is comparatively easy but the more difficult part is everything that happens between the services in distributed systems. That’s where orchestration frameworks like Kubernetes come to rescue. At the same time, microservices need t to minimize synchronous invocations for intra-microservices communications to ensure the best possible isolation. Instead, architects should consider using asynchronous communication between the services. This is why reactive libraries like the ones from the ReactiveX programming, the family has become so popular.
A well-written microservice is generally going to apply the principles of the reactive manifesto. One could assert that a microservices architecture is just an extension of the reactive manifesto that is geared towards web services. But there are related subjects of reactive programming and functional reactive programming which are related to the reactive manifesto. A system can be a reactive system and not use a reactive programming model. Reactive programming is often used to coordinate asynchronous calls to multiple services along with events and streams from clients.
Reactive microservices enabled us to keep the resource costs minimum with a highly scalable, efficient ecosystem. In this session, we dig deeper into the multiple aspects of the challenges, sneak peek with the architecture of the system that keeps delivering for our clients.
This talk aims to be a gentle introduction to Refinement types in Scala. The talk will also introduce many related topics in the subculture of Typelevel programming in FP like Type theory, Generics (Shapeless), Optics (Monocle) and Law-based testing.
Why refinement types?
When 'String' just doesn't cut it anymore. By encoding validation into a type at the edge-of-the-system layer of your application, you can build your core domain logic without having to worry much about type-safety.
Who is it for?
Ajay would be revisiting the necessary foundations at the beginning of the talk, so beginners are welcome. People who have worked on Scala before would be able to appreciate the power of refined types more.
Observability at scale with Neural Networks: A more proactive approachTech Triveni
We at Expedia work on a mission of connecting people to places through the power of technology. To accomplish this, we build and run hundreds of micro-services that provide different functionalities to serve every single customer request, which results in generating billions of events. Now, what happens when one or more services fail at the same time? Well, to improve the observability in our system, we see a need to connect these failure points across our distributed topology to reduce mean time to detect(MTTD) and know (MTTK)
In this talk, we will present the journey of distributed tracing in Expedia that started with Zipkin as a prototype and ended up building our own solution(in open source). We will do a deep dive into our architecture and demonstrate how we ingest terabytes of tracing data (around 8 TB / day) in production with a peak throughput of over 550,000 spans / second for hundreds of micro-services.
We use this data for trending service errors/latencies/rate, perform anomaly detection on the aggregated trends, build service-dependency and network-latency graphs, other than our primary use case of distributed tracing.
With this increasing number, there felt the need to have a real-time intelligent alerting and monitoring system to move towards 24/7 reliability. We will talk about how we use neural networks on trends and perform anomaly detection, including a deep dive into the architecture for the automated training pipeline and online, compute using streams in a cost-effective manner
UI Dev in Big data world using open sourceTech Triveni
He will be sharing his last 10 years of experience in UI Development for Big Data Analytics & ML world using available open-source plethora in the market. How 'UI dev' needs to target big data problems?
Key points to consider while choosing any open-source framework/library for the big data world.
Do you need to write a custom framework or use ready-made open source, when what to choose?
How dev can leverage open source frameworks like Angular, REACT to making big data apps faster?
How you can extend open-source BI tools like Kibana, superset graphana to make UI development tool?
How to show network big data using open source graph libraries?
How to deal with real-time data in Big data UI?
Why use & contribute to open source?
Design UI for future as in Big data world customer problems keep changing with time. Showcasing demo for our real customer's problems, how we achieved using these open source libraries.
Why should a Java programmer shifts towards Functional Programming ParadigmTech Triveni
Functional programming, a buzz word these days. Everyone is trying to learn it. A few functional programming languages are getting attraction and are getting used in the production too such as Scala, Haskell, Clojure and so on. And Even Java has already introduced a few concepts to support functional programming which are Lambdas, Functional Interfaces, Streams, etc. Now the question comes, why should a Java programmer needs to shift towards functional programming.
Java has a very big community and using imperative programming from the last 2 decades. It needs a very solid reason to shift towards the functional programming paradigm. The functional programming paradigm focuses on some key concepts like immutability, higher-order functions and so on and it has a moderate learning curve, but if we can get benefit out of it, then there is no harm in learning functional.
In this talk we will see, what are the benefits we get when we follow the functional programming paradigm in Java, how it makes the developer life easy. We will discuss the comparison between the imperative code vs functional code with some examples.
We will discuss the transition from imperative coding to functional coding with some code examples. This talk will be good for the people who really want to switch to functional programming and want to know how to use that in Java.
Reactive stack paints a very rosy picture of the way to develop the scalable applications focusing on the 4 fundamental things that are responsive, elastic, resilient and asynchronous communication. The principles are pretty simple but there are a lot of pitfalls that nobody talks about.
The challenges are numerous to build the system in the right way and in this talk we will focus on what are these pitfalls and how can we avoid them. We will be exploring the myth that once you adapt to it the journey will be smooth and show how these distributed systems add to additional complexity but can be managed by making smart decisions. I will share our experience of building Reactive Applications and how we have overcome the difficulties that we encounter.
Reactive programming is a new concept that is catching everyone’s eyes these days. The concept has been adopted by the various aspects of software engineering be it application development or DevOps. Our software development languages are also not untouched from it.
So, how can JAVA which has such a large community refrain itself from going reactive? The foundational topics for this talk will revolve around the ideas of reactive programming and what steps JAVA has taken towards being reactive. This would involve the latest buzz words in the market: Reactive streams, Reactive stream specification, the concept of mono and flux. We will also be touching how spring has used these features of reactive streams to make a new API development framework: Spring Boot Webflux. We hope the talk will help to understand Reactive programming aspects of JAVA and it will not bewilder the users as now they know that it’s a coding style that centres on the effective management of changes with async data streams.
Tackling Asynchrony with Kotlin CoroutinesTech Triveni
Reactive Programming is an approach to asynchronous programming. Like every other tool, reactive programming tools like RxJava or Reactor come with their own challenges. Kotlin Coroutines alleviates many of these challenges. Kotlin Coroutines, when being designed, had the advantage of being able to explore existing code that uses reactive stream.
This talk will highlight some of these practical challenges and show how Kotlin Coroutines tackle them. The challenges that will be covered are changes in interface design, programming paradigm shift, reactive type selection, exception handling, cancellation, resource leakage, and sequential vs concurrent.
Programmatic Ad Tracking: Let the power of Reactive Microservices do talkingTech Triveni
We at MiQ bid for billions of impressions every day. This comes at a cost and many technical challenges. After the ad is served we need a mechanism to share insights with clients. We need an application to gather these insights on a periodic basis.
Building microservices is comparatively easy but the more difficult part is everything that happens between the services in distributed systems. That’s where orchestration frameworks like Kubernetes come to rescue. At the same time, microservices need t to minimize synchronous invocations for intra-microservices communications to ensure the best possible isolation. Instead, architects should consider using asynchronous communication between the services. This is why reactive libraries like the ones from the ReactiveX programming, the family has become so popular.
A well-written microservice is generally going to apply the principles of the reactive manifesto. One could assert that a microservices architecture is just an extension of the reactive manifesto that is geared towards web services. But there are related subjects of reactive programming and functional reactive programming which are related to the reactive manifesto. A system can be a reactive system and not use a reactive programming model. Reactive programming is often used to coordinate asynchronous calls to multiple services along with events and streams from clients.
Reactive microservices enabled us to keep the resource costs minimum with a highly scalable, efficient ecosystem. In this session, we dig deeper into the multiple aspects of the challenges, sneak peek with the architecture of the system that keeps delivering for our clients.
This talk aims to be a gentle introduction to Refinement types in Scala. The talk will also introduce many related topics in the subculture of Typelevel programming in FP like Type theory, Generics (Shapeless), Optics (Monocle) and Law-based testing.
Why refinement types?
When 'String' just doesn't cut it anymore. By encoding validation into a type at the edge-of-the-system layer of your application, you can build your core domain logic without having to worry much about type-safety.
Who is it for?
Ajay would be revisiting the necessary foundations at the beginning of the talk, so beginners are welcome. People who have worked on Scala before would be able to appreciate the power of refined types more.
Observability at scale with Neural Networks: A more proactive approachTech Triveni
We at Expedia work on a mission of connecting people to places through the power of technology. To accomplish this, we build and run hundreds of micro-services that provide different functionalities to serve every single customer request, which results in generating billions of events. Now, what happens when one or more services fail at the same time? Well, to improve the observability in our system, we see a need to connect these failure points across our distributed topology to reduce mean time to detect(MTTD) and know (MTTK)
In this talk, we will present the journey of distributed tracing in Expedia that started with Zipkin as a prototype and ended up building our own solution(in open source). We will do a deep dive into our architecture and demonstrate how we ingest terabytes of tracing data (around 8 TB / day) in production with a peak throughput of over 550,000 spans / second for hundreds of micro-services.
We use this data for trending service errors/latencies/rate, perform anomaly detection on the aggregated trends, build service-dependency and network-latency graphs, other than our primary use case of distributed tracing.
With this increasing number, there felt the need to have a real-time intelligent alerting and monitoring system to move towards 24/7 reliability. We will talk about how we use neural networks on trends and perform anomaly detection, including a deep dive into the architecture for the automated training pipeline and online, compute using streams in a cost-effective manner
Semi-Supervised Insight Generation from Petabyte Scale Text DataTech Triveni
Existing state-of-the-art supervised methods in Machine Learning require large amounts of annotated data to achieve good performance and generalization. However, manually constructing such a training data set with sentiment labels is a labor-intensive and time-consuming task. With the proliferation of data acquisition in domains such as images, text and video, the rate at which we acquire data is greater than the rate at which we can label them. Techniques that reduce the amount of labeled data needed to achieve competitive accuracies are of paramount importance for deploying scalable, data-driven, real-world solutions.
At Envestnet | Yodlee, we have deployed several advanced state-of-the-art Machine Learning solutions that process millions of data points on a daily basis with very stringent service level commitments. A key aspect of our Natural Language Processing solutions is Semi-supervised learning (SSL): A family of methods that also make use of unlabelled data for training – typically a small amount of labeled data with a large amount of unlabelled data. Pure supervised solutions fail to exploit the rich syntactic structure of the unlabelled data to improve decision boundaries. There is an abundance of published work in the field - but few papers have succeeded in showing significantly better results than state-of-the-art supervised learning. Often, methods have simplifying assumptions that fail to transfer to real-world scenarios. There is a lack of practical guidelines for deploying effective SSL solutions. We attempt to bridge that gap by sharing our learning from successful SSL models deployed in production
Finding the best solution for Image ProcessingTech Triveni
What is beyond using Tensorflow, GPU or TPU to process images seamlessly? Do we have a silver bullet for image processing? Over the years, image processing has picked up a different level of attraction. Everyone can think about its ease of usability because it has become a reality now. We have started seeing how Residual Neural Network architecture is being used for different cases and not only that, how Residual Neural network is being tweaked to solve different problems. Along with tweaking the ResNet, preprocessing is also being improved to support different architecture for this matter.
Everyone has almost become cyborg already with mobile phones in our hands and apparently until human beings bring the AI/ML to the phones completely they are not taking any rest. We are going to see the development of different architecture and algorithms around running AI/ML on low configuration devices.
In this session, we are going to talk about different research papers submitted for these matters and some implementations for the same as well.
Proximity Targeting at Scale using Big Data PlatformsTech Triveni
Proximity Targeting is a marketing technique that uses mobile location services to reach consumers in real-time when they are around a store location or point of interest. This is done by defining a radius around a specific location. If a consumer has opted into location services on their mobile phone and enters within this radius, proximity targeting helps in triggering an advertisement or message to consumers in an effort to influence their behaviour. This can be combined with the ability to purchase impressions through programmatic ad platforms that are powered by real-time bidding which can help businesses formulate the right strategy of influencing their users on a particular geographical area. They can build user groups based on certain characteristics (such as neighbourhoods, demographics, interests, and other data), and subsequently launch another campaign that targets anyone which those characteristics.
The growth of mobile devices has led to enormous data generation which offers tremendous potential when used effectively for business. Thus we need an efficient platform where we can process such huge data efficiently and with minimum latency and cost. This talk describes MIQ's journey into building a fast and scalable processing platform using Big Data, delivering faster and actionable insights for Proximity targeting which has empowered the creation of a product generating ~30 million dollar revenue on a year to year basis.
Effecting Pure Change - How anything ever gets done in functional programming...Tech Triveni
Newcomers to functional programming are often mystified when they encounter pure functions and immutable data structures. A mathematical function which always produces the same output for the same input is so inflexible as to be almost useless! And surely how can you even represent even the simplest of dynamic program state without variables to store it in, to say nothing of fancy user interfaces, and complex input output.
This talk will present an overview of the various techniques that are used by functional programming languages to tackle state and external "effects" which are needed for any real world program. It will cover a large landscape ranging from Monads, to Algebraic Effects, to Functional Reactive Programming. And it will show how functional programming can be as *useful* for real world programs, as it is *beautiful*.
Becoming a Functional Programmer - Harit Himanshu (Nomis Solutions)Tech Triveni
As programmers, we write programs which makes our workflow faster while adding business value to the products and services. These often involve working with an Imperative programming language such as Java and working with object-oriented styles. This becomes like a second nature as a programmer but is also very limiting in terms of what could be expressed using these tools. Functional Programming, on the other hand, opens to a whole new breed or programming designs which often seems overwhelming to the aspiring functional programmers. However, learning functional programming is often fun and easy if started with the right set of idioms and learning the complex concepts as a building blocks one on top of the other. In this talk, we will start from functions and keep adding more concepts to the point where the developers might feel comfortable going back home, picking up a book or a course to further immerse themselves into this journey. The programming language of choice would be Scala for this talk.
We will start with plain-old functions, teaching them the concepts such as referential transparency, higher-order functions, function literals, Scala collections hierarchy and looking at some concurrency concepts with examples. By the end of the talk, the audience will have a deeper insight on this style of programming and would be able to make informed choices about their next steps in the journey of functional programming and Scala.
Live coding session on AI / ML using Google Tensorflow (Python) - Tanmoy Deb ...Tech Triveni
Build your own system, extend your existing systems through ML capabilities. Machine learning is about teaching computers how to learn from data to make decisions or predictions. For true machine learning, the computer must be able to learn to identify patterns without being explicitly programmed to. The topic will give briefly cover how anybody can learn and start their journey in AI, discussing the opportunities and challenges from point of view of a student, developer, and entrepreneur. The take away from the session will be to take that first step beyond the question- "where to start? There is too much out there!". This will be given with a demo that how most popular framework for Deep Learning works.
Distributing the SMACK stack - Kubernetes VS DCOS - Sahil Sawhney (Knoldus Inc.)Tech Triveni
The session will revolve around the merits and demerits of running SMACK stack over Kubernetes and DCOS. We will start with first discussing how SMACK stack operates in a non distributed environment and identify the problems faced. We will then take a look at how SMACK stack could be deployed and used in distributed environments like Kubernetes and DCOS, the leading distributed operating system/orchestration tools. The session will end with a face of between DCOS and Kubernetes and we would try to identify which of the two is best to host SMACK stack over it. Keeping in mind the 45 mints duration of the session, the following are the pointers we would stress upon in our discussion :
1). The old school way (10 Minutes)
a. Overview of how the SMACK stack used to run in a non distributed environment
b. It's advantages
c. It's disadvantages
2). Overview of running SMACK stack over DCOS (10 minutes)
a. Advantages and ease of use of SMACK stack in DCOS
b. Any disadvantage/drawback
3). Overview of running SMACK stack over Kubernetes (10 minutes)
a. Advantages and ease of use of SMACK stack in Kubernetes
b. Any disadvantage/drawback
4). Compare/contrast performance of SMACK stack over DCOS and Kubernetes (15 minutes)
Blue Pill / Red Pill : The Matrix of thousands of data streams - Himanshu Gup...Tech Triveni
Designing a streaming application which has to process data from 1 or 2 streams is easy. Any streaming framework which provides scalability, high-throughput, and fault-tolerance would work. But when the number of streams starts growing in order 100s or 1000s, managing them can be daunting. How would you share resources among 1000s of streams with all of them running 24x7? Manage their state, Apply advanced streaming operations, Add/Delete streams without restarting? This talk explains common scenarios & shows techniques that can handle thousands of streams using Spark Structured Streaming.
UX in Big Data Analytics - Paramjit Jolly (Guavus)Tech Triveni
I will mainly presenting my experience of UX/UI in big data analytics in last 10 years in Guavus company (Big data analytics firms).
Key points:
1. Big data – What, Who, Why
2. Our real examples of Big data applications
3. Our UX/UI learning in last10 Years in Big data space
4. How to Simplify – Big data problems
5. Key skills you need to enter in Big data space as UX/UI
6. Future in Big data analytics
Keeping the functional paradigm intact while using complicated monad structure in your code could be quite a tedious task. Especially, when your business logic needs to be structured in a flow, suddenly you realize that your code is moving away from the functional paradigm. Well, definitely Monads composition is the savior in this kind of situations, however, composing them practically is again a cumbersome task. We will be doing live coding examples in this talk, which would hopefully make you sit back and relax when you face this kind of situation again. We will create custom monads, right usage of monadic operator and resolution of monad composition problems and monads transformation with some real-life scenarios and examples.
Micro Frontends Architecture is micro service approach for Frontend development. Micro Frontends thinks web-app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in it. A team is cross functional and develops its features end-to-end, from database to user interface and take care of CI/CD. Micro service architechure is well know concept for backend point of view but In frontend we need to follow diffrent type of design pattern to achieve this.
Key Take away:
1. Learn about Micro Frontend
2. How to practically use them
3. Key challenges
Apache CarbonData+Spark to realize data convergence and Unified high performa...Tech Triveni
Challenges in Data Analytics:
Different application scenarios need different storage solutions: HBASE is ideal for point query scenarios but unsuitable for multi-dimensional queries. MPP is suitable for data warehouse scenarios but engine and data are coupled together which hampers scalability. OLAP stores used in BI applications perform best for Aggregate queries but full scan queries perform at a sub-optimal performance. Moreover, they are not suitable for real-time analysis. These distinct systems lead to low resource sharing and need different pipelines for data and application management.
Micro Frontends Architecture is micro service approach for Frontend development. Micro Frontends thinks web-app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in it. A team is cross functional and develops its features end-to-end, from database to user interface and take care of CI/CD. Micro service architechure is well know concept for backend point of view but In frontend we need to follow diffrent type of design pattern to achieve this.
Key Take away:
1. Learn about Micro Frontend
2. How to practically use them
3. Key challenges
Augmentation of bids for programmatic ad auctions @ real time with the power ...Tech Triveni
We at MiQ bid for billions of impressions everyday. This comes at a cost, and a lot many technical challenges. A million+ requests per second with response time limited to less than 10ms, Reactive programming enabled us to keep the resource costs minimum; with highly scalable and efficient ecosystem. In this session we delve deeper into the multiple aspects of the challenges, alongside a brush with the architecture of the system that keeps delivering for us.
Programmable Decision Tree @Scale for Programmatic Media Buying - Rohit Sriva...Tech Triveni
Programmable Decision tree is a logical decisioning framework for optimizations in programmatic media buying.This session would outline the evolution of framework over time with various big data tech stack usages and their choices preferred over each other.
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.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Semi-Supervised Insight Generation from Petabyte Scale Text DataTech Triveni
Existing state-of-the-art supervised methods in Machine Learning require large amounts of annotated data to achieve good performance and generalization. However, manually constructing such a training data set with sentiment labels is a labor-intensive and time-consuming task. With the proliferation of data acquisition in domains such as images, text and video, the rate at which we acquire data is greater than the rate at which we can label them. Techniques that reduce the amount of labeled data needed to achieve competitive accuracies are of paramount importance for deploying scalable, data-driven, real-world solutions.
At Envestnet | Yodlee, we have deployed several advanced state-of-the-art Machine Learning solutions that process millions of data points on a daily basis with very stringent service level commitments. A key aspect of our Natural Language Processing solutions is Semi-supervised learning (SSL): A family of methods that also make use of unlabelled data for training – typically a small amount of labeled data with a large amount of unlabelled data. Pure supervised solutions fail to exploit the rich syntactic structure of the unlabelled data to improve decision boundaries. There is an abundance of published work in the field - but few papers have succeeded in showing significantly better results than state-of-the-art supervised learning. Often, methods have simplifying assumptions that fail to transfer to real-world scenarios. There is a lack of practical guidelines for deploying effective SSL solutions. We attempt to bridge that gap by sharing our learning from successful SSL models deployed in production
Finding the best solution for Image ProcessingTech Triveni
What is beyond using Tensorflow, GPU or TPU to process images seamlessly? Do we have a silver bullet for image processing? Over the years, image processing has picked up a different level of attraction. Everyone can think about its ease of usability because it has become a reality now. We have started seeing how Residual Neural Network architecture is being used for different cases and not only that, how Residual Neural network is being tweaked to solve different problems. Along with tweaking the ResNet, preprocessing is also being improved to support different architecture for this matter.
Everyone has almost become cyborg already with mobile phones in our hands and apparently until human beings bring the AI/ML to the phones completely they are not taking any rest. We are going to see the development of different architecture and algorithms around running AI/ML on low configuration devices.
In this session, we are going to talk about different research papers submitted for these matters and some implementations for the same as well.
Proximity Targeting at Scale using Big Data PlatformsTech Triveni
Proximity Targeting is a marketing technique that uses mobile location services to reach consumers in real-time when they are around a store location or point of interest. This is done by defining a radius around a specific location. If a consumer has opted into location services on their mobile phone and enters within this radius, proximity targeting helps in triggering an advertisement or message to consumers in an effort to influence their behaviour. This can be combined with the ability to purchase impressions through programmatic ad platforms that are powered by real-time bidding which can help businesses formulate the right strategy of influencing their users on a particular geographical area. They can build user groups based on certain characteristics (such as neighbourhoods, demographics, interests, and other data), and subsequently launch another campaign that targets anyone which those characteristics.
The growth of mobile devices has led to enormous data generation which offers tremendous potential when used effectively for business. Thus we need an efficient platform where we can process such huge data efficiently and with minimum latency and cost. This talk describes MIQ's journey into building a fast and scalable processing platform using Big Data, delivering faster and actionable insights for Proximity targeting which has empowered the creation of a product generating ~30 million dollar revenue on a year to year basis.
Effecting Pure Change - How anything ever gets done in functional programming...Tech Triveni
Newcomers to functional programming are often mystified when they encounter pure functions and immutable data structures. A mathematical function which always produces the same output for the same input is so inflexible as to be almost useless! And surely how can you even represent even the simplest of dynamic program state without variables to store it in, to say nothing of fancy user interfaces, and complex input output.
This talk will present an overview of the various techniques that are used by functional programming languages to tackle state and external "effects" which are needed for any real world program. It will cover a large landscape ranging from Monads, to Algebraic Effects, to Functional Reactive Programming. And it will show how functional programming can be as *useful* for real world programs, as it is *beautiful*.
Becoming a Functional Programmer - Harit Himanshu (Nomis Solutions)Tech Triveni
As programmers, we write programs which makes our workflow faster while adding business value to the products and services. These often involve working with an Imperative programming language such as Java and working with object-oriented styles. This becomes like a second nature as a programmer but is also very limiting in terms of what could be expressed using these tools. Functional Programming, on the other hand, opens to a whole new breed or programming designs which often seems overwhelming to the aspiring functional programmers. However, learning functional programming is often fun and easy if started with the right set of idioms and learning the complex concepts as a building blocks one on top of the other. In this talk, we will start from functions and keep adding more concepts to the point where the developers might feel comfortable going back home, picking up a book or a course to further immerse themselves into this journey. The programming language of choice would be Scala for this talk.
We will start with plain-old functions, teaching them the concepts such as referential transparency, higher-order functions, function literals, Scala collections hierarchy and looking at some concurrency concepts with examples. By the end of the talk, the audience will have a deeper insight on this style of programming and would be able to make informed choices about their next steps in the journey of functional programming and Scala.
Live coding session on AI / ML using Google Tensorflow (Python) - Tanmoy Deb ...Tech Triveni
Build your own system, extend your existing systems through ML capabilities. Machine learning is about teaching computers how to learn from data to make decisions or predictions. For true machine learning, the computer must be able to learn to identify patterns without being explicitly programmed to. The topic will give briefly cover how anybody can learn and start their journey in AI, discussing the opportunities and challenges from point of view of a student, developer, and entrepreneur. The take away from the session will be to take that first step beyond the question- "where to start? There is too much out there!". This will be given with a demo that how most popular framework for Deep Learning works.
Distributing the SMACK stack - Kubernetes VS DCOS - Sahil Sawhney (Knoldus Inc.)Tech Triveni
The session will revolve around the merits and demerits of running SMACK stack over Kubernetes and DCOS. We will start with first discussing how SMACK stack operates in a non distributed environment and identify the problems faced. We will then take a look at how SMACK stack could be deployed and used in distributed environments like Kubernetes and DCOS, the leading distributed operating system/orchestration tools. The session will end with a face of between DCOS and Kubernetes and we would try to identify which of the two is best to host SMACK stack over it. Keeping in mind the 45 mints duration of the session, the following are the pointers we would stress upon in our discussion :
1). The old school way (10 Minutes)
a. Overview of how the SMACK stack used to run in a non distributed environment
b. It's advantages
c. It's disadvantages
2). Overview of running SMACK stack over DCOS (10 minutes)
a. Advantages and ease of use of SMACK stack in DCOS
b. Any disadvantage/drawback
3). Overview of running SMACK stack over Kubernetes (10 minutes)
a. Advantages and ease of use of SMACK stack in Kubernetes
b. Any disadvantage/drawback
4). Compare/contrast performance of SMACK stack over DCOS and Kubernetes (15 minutes)
Blue Pill / Red Pill : The Matrix of thousands of data streams - Himanshu Gup...Tech Triveni
Designing a streaming application which has to process data from 1 or 2 streams is easy. Any streaming framework which provides scalability, high-throughput, and fault-tolerance would work. But when the number of streams starts growing in order 100s or 1000s, managing them can be daunting. How would you share resources among 1000s of streams with all of them running 24x7? Manage their state, Apply advanced streaming operations, Add/Delete streams without restarting? This talk explains common scenarios & shows techniques that can handle thousands of streams using Spark Structured Streaming.
UX in Big Data Analytics - Paramjit Jolly (Guavus)Tech Triveni
I will mainly presenting my experience of UX/UI in big data analytics in last 10 years in Guavus company (Big data analytics firms).
Key points:
1. Big data – What, Who, Why
2. Our real examples of Big data applications
3. Our UX/UI learning in last10 Years in Big data space
4. How to Simplify – Big data problems
5. Key skills you need to enter in Big data space as UX/UI
6. Future in Big data analytics
Keeping the functional paradigm intact while using complicated monad structure in your code could be quite a tedious task. Especially, when your business logic needs to be structured in a flow, suddenly you realize that your code is moving away from the functional paradigm. Well, definitely Monads composition is the savior in this kind of situations, however, composing them practically is again a cumbersome task. We will be doing live coding examples in this talk, which would hopefully make you sit back and relax when you face this kind of situation again. We will create custom monads, right usage of monadic operator and resolution of monad composition problems and monads transformation with some real-life scenarios and examples.
Micro Frontends Architecture is micro service approach for Frontend development. Micro Frontends thinks web-app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in it. A team is cross functional and develops its features end-to-end, from database to user interface and take care of CI/CD. Micro service architechure is well know concept for backend point of view but In frontend we need to follow diffrent type of design pattern to achieve this.
Key Take away:
1. Learn about Micro Frontend
2. How to practically use them
3. Key challenges
Apache CarbonData+Spark to realize data convergence and Unified high performa...Tech Triveni
Challenges in Data Analytics:
Different application scenarios need different storage solutions: HBASE is ideal for point query scenarios but unsuitable for multi-dimensional queries. MPP is suitable for data warehouse scenarios but engine and data are coupled together which hampers scalability. OLAP stores used in BI applications perform best for Aggregate queries but full scan queries perform at a sub-optimal performance. Moreover, they are not suitable for real-time analysis. These distinct systems lead to low resource sharing and need different pipelines for data and application management.
Micro Frontends Architecture is micro service approach for Frontend development. Micro Frontends thinks web-app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in it. A team is cross functional and develops its features end-to-end, from database to user interface and take care of CI/CD. Micro service architechure is well know concept for backend point of view but In frontend we need to follow diffrent type of design pattern to achieve this.
Key Take away:
1. Learn about Micro Frontend
2. How to practically use them
3. Key challenges
Augmentation of bids for programmatic ad auctions @ real time with the power ...Tech Triveni
We at MiQ bid for billions of impressions everyday. This comes at a cost, and a lot many technical challenges. A million+ requests per second with response time limited to less than 10ms, Reactive programming enabled us to keep the resource costs minimum; with highly scalable and efficient ecosystem. In this session we delve deeper into the multiple aspects of the challenges, alongside a brush with the architecture of the system that keeps delivering for us.
Programmable Decision Tree @Scale for Programmatic Media Buying - Rohit Sriva...Tech Triveni
Programmable Decision tree is a logical decisioning framework for optimizations in programmatic media buying.This session would outline the evolution of framework over time with various big data tech stack usages and their choices preferred over each other.
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.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
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.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
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
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.
3. 3
❑ HOME PAGE
https://fpncr.github.io
❑ GETTOGETHER COMMUNITY
https://gettogether.community/fpncr/
❑ MEETUP
https://www.meetup.com/DelhiNCR-Haskell-And-
Functional-Programming-Languages-Group
❑ TELEGRAM:
https://t.me/fpncr
Functional Programming NCR
4. 4
❑Type safety. Eliminates a large class of errors.
❑Effectful values are first class
❑Higher Order Patterns
❑Reduction in Boilerplate
❑Zero Cost Code Reuse
Overview
5. 5
❑Order of operations matters
❑Contrast with functional, where the order of
operations does not matter.
Define “Imperative”
6. 6
write "Do you want a pizza?”
if (read() == "Yes") orderPizza()
write "Should I launch missiles?”
if (read() == "Yes") launchMissiles()
Imperative is simple
7. 7
write "Do you want a pizza?”
if (read() == "Yes") orderPizza()
write "Should I launch missiles?”
if (read() == "Yes") launchMissiles()
Imperative is simple
You REALLY DON’T
want to do these
out of order
8. 8
do
write "Do you want a pizza?"
canOrder <- read
When (canOrder == "Yes") orderPizza
write "Should I launch missiles?"
canLaunch <- read
When (canLaunch == "Yes") launchMissiles
Functional?
9. 9
do
write "Do you want a pizza?"
canOrder <- read
when (canOrder == "Yes") orderPizza
write "Should I launch missiles?"
canLaunch <- read
when (canLaunch == "Yes") launchMissiles
Functional?
Haskell
10. 10
write "Do you want a pizza?" >>= _ ->
read >>= canOrderPizza ->
if (canOrderPizza == "Yes") then
orderPizza
else pure () >>= _ ->
write "Should I launch missiles?" >>= _ -
>
read >>= canLaunchMissiles ->
if (canLaunchMissiles == "Yes") then
launchMissiles
else pure ()
Functional?
11. 11
plusOne = x -> x+1
add = x -> y -> x+y
A bit of syntax
Lambdas
14. 14
write "Do you want a pizza?" >>= _ ->
read >>= canOrderPizza ->
if (canOrderPizza == "Yes") then
orderPizza
else pure ()
One At a Time
15. 15
write "Should I launch missiles?" >>= _ ->
read >>= canLaunchMissiles ->
if (canLaunchMissiles == "Yes") then
launchMissiles
else pure ()
One At a Time
18. 18
handlePizza :: IO ()
handlePizza = do
write "Do you want a pizza?"
canOrderPizza <- read
if (canOrderPizza == "Yes")
then orderPizza
else pure ()
Types This entire block
1. Is Effectful
2. Returns ()
25. 25
handlePizza :: IO Bool
handlePizza = do
write "Do you want a pizza?"
canOrderPizza <- read
if (canOrderPizza == "Yes")
then orderPizza >> pure true
else pure false
Types
27. 27
❑Ask the user a bunch of questions
❑Then perform a bunch of actions
Reorder?
28. 28
Must Rearchitect
do
write "Do you want a pizza?"
canOrder <- read
write "Should I launch missiles?"
canLaunch <- read
when (canOrder == "Yes") orderPizza
when (canLaunch == "Yes") launchMissiles
29. 29
Must Rearchitect
do
write "Do you want a pizza?"
canOrder <- read
write "Should I launch missiles?"
canLaunch <- read
when (canOrder == "Yes") orderPizza
when (canLaunch == "Yes") launchMissiles
But we have lost
the separation
between
Ordering pizza
and Launching nukes
30. 30
We Need
❑Define complex flows with user input and a final
effect to be performed
❑To compose these flows without boilerplate
❑Be able to run the final effects together at the end
of all user input
31. 31
Desired Abstraction
handlePizza = ...
handleNukes = ...
do
handlePizza
handleNukes
We ask questions in this order,
but the final effect of ordering pizza
and launching nukes should only
happen together at the end
33. 33
Must Rearchitect
handlePizza :: IO (IO ())
handlePizza = do
write "Do you want a pizza?"
canOrder <- read
return $
when (canOrder == "Yes") orderPizza
Return value is a CLOSURE
Captures `canOrder`
34. 34
Must Rearchitect
handleNukes :: IO (IO ())
handleNukes = do
write “Should I launch nukes?"
canLaunch <- read
return $
when (canLaunch == "Yes") launchNukes
Return value is a CLOSURE
Captures `canLaunch`
38. 38
And Allow A Way to
specify “No Effects”
finalEffect = emptyEffects
39. 39
Looks Like a Monoid!
class Monoid M where
empty :: M
(<>) :: M -> M -> M
40. 40
IO already is a
Monoid!
❑What happens when we do the following?
handlePizza <> handleNukes
41. 41
IO already is a
Monoid!
instance Monoid a => Monoid (IO a) where
empty = pure empty
f <> g = do
a <- f
b <- g
pure (a <> b)
42. 42
IO already is a
Monoid!
instance Monoid a => Monoid (IO a) where
empty = pure empty
f <> g = do
a <- f
b <- g
pure (a <> b)
First perform individual effects
43. 43
IO already is a
Monoid!
instance Monoid a => Monoid (IO a) where
empty = pure empty
f <> g = do
a <- f
b <- g
pure (a <> b) Then Join the results
As Monoids
44. 44
IO already is a
Monoid!
❑So this does the right thing!
do
finalEffects <- handlePizza <> handleNukes
finalEffects
45. 45
This is also a pattern
join :: Monad M => M (M a) -> M a
join :: IO (IO a) -> IO a
join (handlePizza <> handleNukes)
46. 46
No Boilerplate!
join :: Monad M => M (M a) -> M a
join :: IO (IO a) -> IO a
join (handlePizza <> handleNukes)
48. 48
Final Code
handleNukes
handleNukes :: IO (IO ())
handleNukes = do
write “Should I launch nukes?"
canLaunch <- read
return $
when (canLaunch == "Yes") launchNukes
49. 49
Final Code
Combine flows together
join (handlePizza <> handleNukes <> ...)
join (mappend [ handlePizza
, handleNukes
...
])
Or Perhaps
50. 50
❑We don’t launch nukes without ordering pizza
❑We don’t order pizza when not launching nukes
Change Requirements
Again
51. 51
Must Rearchitect
do
write "Do you want a pizza?"
canOrder <- read
write "Should I launch missiles?"
canLaunch <- read
when (canOrder == “Yes" && canLaunch ==
"Yes") (orderPizza >> launchMissiles)
52. 52
Must Rearchitect
do
write "Do you want a pizza?"
canOrder <- read
write "Should I launch missiles?"
canLaunch <- read
when (canOrder == “Yes" && canLaunch ==
"Yes") (orderPizza >> launchMissiles)
Business Logic
54. 54
We Need
❑Define complex flows with user input and a final
effect to be performed
❑To compose these flows without boilerplate
❑Call a function on all the user input to determine if
we should perform the final effects.
❑Be able to run the final effects together at the end
of all user input
55. 55
Can we do this with
Monoids?
do
finalEffects <- handlePizza <> handleNukes
finalEffects
❑We abstracted away the captured variables
❑Now all we can do is run the final composed effect
We can’t access `canOrder` or `canLaunch` here
57. 57
Let's work through this
data Ret a = Ret
{ input :: a
, effect :: IO ()
}
❑Return the final effect, AND the user input
❑Parameterise User Input as `a`
58. 58
Let's work through this
handlePizza :: IO (Ret Boolean)
handlePizza = do
write "Do you want a pizza?"
canOrder <- read
return $ Ret canOrder $
when (canOrder == "Yes") orderPizza
59. 59
Compose Effects
do
retPizza <- handlePizza
retNuke <- handleNuke
when valid (input retPizza) (input
retNuke) do
effect retPizza
effect retNuke
60. 60
Compose Effects
do
retPizza <- handlePizza
retNuke <- handleNuke
when valid (input retPizza) (input
retNuke) do
effect retPizza
effect retNuke
UGH! Boilerplate!
61. 61
Compose Effects
do
retPizza <- handlePizza
retNuke <- handleNuke
let go = valid (input retPizza) (input
retNuke)
when go do
effect retPizza
effect retNuke
62. 62
Compose Effects
do
retPizza <- handlePizza
retNuke <- handleNuke
let go = valid (input retPizza) (input
retNuke)
when go do
effect retPizza
effect retNuke
Applicative!
63. 63
IO is an Applicative
instance Applicative IO where
f <*> a = do
f' <- f
a' <- a
pure (f' a')
64. 64
Try to Use Applicative IO
do
go <- valid
<$> (input <$> handlePizza)
<*> (input <$> handleNuke)
when go do
effect ??retPizza
effect ??retNuke
65. 65
Dial Back a Little
do
(retPizza, retNuke) <- (,)
<$> handlePizza
<*> handleNuke
let go = valid
<$> input retPizza
<*> input retNuke
when go do
effect retPizza
effect retNuke
66. 66
Perhaps a try a
different abstraction
do
(retPizza, retNuke) <- (,)
<$> handlePizza
<*> handleNuke
let go = valid
<$> input retPizza
<*> input retNuke
when go do
effect retPizza
effect retNuke
This is a common pattern
Can we abstract this?
67. 67
Running a Return value
data Ret a = Ret
{ input :: a
, effect :: IO ()}
runRet :: Ret Bool -> IO ()
runRet (Ret b e) = when b e
68. 68
More trouble than its
worth?
do
(retPizza, retNuke) <- (,)
<$> handlePizza
<*> handleNuke
let go = valid
<$> input retPizza
<*> input retNuke
runRet ??? We need to Compose a Ret
To be able to run it
69. 69
However!
do
(retPizza, retNuke) <- (,)
<$> handlePizza
<*> handleNuke
let go = valid
<$> input retPizza
<*> input retNuke
runRet ???
This could return a
Ret instead!
70. 70
Combining Return values
data Ret a = Ret
{ input :: a
, effect :: IO ()}
instance Functor Ret where
fmap f (Ret a e) = Ret (f a) e
instance Applicative Ret where
Ret f e1 <*> Ret a e2 =
Ret (f a) (e1 <> e2)
72. 72
Hmm, Still Boilerplatey
do
(retPizza, retNuke) <- (,)
<$> handlePizza
<*> handleNuke
let ret = valid
<$> retPizza
<*> retNuke
runRet ret
Two Successive
Applicatives
73. 73
Hmm, Still Boilerplatey
do
(retPizza, retNuke) <- (,)
<$> handlePizza
<*> handleNuke
let ret = valid
<$> retPizza
<*> retNuke
runRet ret
Combine Effectful
IO
Combine Effectful
Ret
74. 74
Compose Applicatives?
data IO a = ...
data Ret a = Ret
{ input :: a
, effect :: IO ()}
type Flow a = IO (Ret a)
We need an Applicative instance for Flow
77. 77
Running Compose
runRet :: Ret Bool -> IO ()
runRet (Ret b e) = when b e
runFlow :: Compose IO Ret Bool -> IO ()
runFlow (Compose e) = e >>= runRet
78. 78
Defining Flows
handlePizza :: Flow Boolean
handlePizza = Compose $ do
write "Do you want a pizza?"
canOrder <- read
return $ Ret canOrder $
when (canOrder == "Yes") orderPizza
81. 81
❑Type safety. Eliminates a large class of errors.
❑Effectful values are first class
❑Higher Order Patterns
❑Reduction in Boilerplate
❑Zero Cost Code Reuse
Takeaways