Take idiomatic C# and apply a few favorite patterns and concepts from functional languages like F# to make something hopefully more expressive, more elegant, and less bug-prone.
A talk by Bob Davidson for South Dakota Code Camp 2016.
Introduction to the basics of Python programming (part 3)Pedro Rodrigues
This is the 3rd part of a multi-part series that teaches the basics of Python programming. It covers list and dict comprehensions, functions, modules and packages.
The basics of Python are rather straightforward. In a few minutes you can learn most of the syntax. There are some gotchas along the way that might appear tricky. This talk is meant to bring programmers up to speed with Python. They should be able to read and write Python.
Design Patterns - Compiler Case Study - Hands-on ExamplesGanesh Samarthyam
This presentation takes a case-study based approach to design patterns. A purposefully simplified example of expression trees is used to explain how different design patterns can be used in practice. Examples are in C#, but is relevant for anyone who is from object oriented background.
Introduction to the basics of Python programming (part 3)Pedro Rodrigues
This is the 3rd part of a multi-part series that teaches the basics of Python programming. It covers list and dict comprehensions, functions, modules and packages.
The basics of Python are rather straightforward. In a few minutes you can learn most of the syntax. There are some gotchas along the way that might appear tricky. This talk is meant to bring programmers up to speed with Python. They should be able to read and write Python.
Design Patterns - Compiler Case Study - Hands-on ExamplesGanesh Samarthyam
This presentation takes a case-study based approach to design patterns. A purposefully simplified example of expression trees is used to explain how different design patterns can be used in practice. Examples are in C#, but is relevant for anyone who is from object oriented background.
in this how the split() function work with string in python is discussed
TO DOWNLOAD MORE INFORMATION:
https://computerassignmentsforu.blogspot.com/p/stringinpythonsplit.html
VIDEO TUTORIAL LINK:
https://youtu.be/6BvslDmk1Z8
Ruby plays to many programming paradigms. It's an object-oriented language that can be used in a functional or an imperative/procedural way. But Ruby does not often get used as a logic programming language. In this talk I'll explore logic programming using Ruby. What is it, and is it a tool you want to add to your toolbox? We'll touch on several libraries, we'll primary look at an implementation of minikanren (http://minikanren.org/) for Ruby.
Presentation on using the Arrow library for enhanced Functional Programming in the Kotlin Language. Delivered at the Northern Ireland Developer Conference 2018.
Using the Arrow Library to increase the Functional Programming potential of the Kotlin Language. Presented to the Cork Java Users Group and Cork Functional Programmers on 1st May 2018
Slides from the talk we did with Maurice Naftalin for Devoxx Belgium 2019.
Functional programmers have been saying for decades that they know the way to the future.
Clearly they have been wrong, since imperative languages are still far more popular.
Clearly they have also been right, as the advantages of functional programming have become increasingly obvious. Is it possible to face both ways, and combine the two models?
Scala is one language that does this, and Java too has been on a journey, which still continues, of learning from functional languages and carefully adding features from them.
In this talk, we will review what Java has learned from functional languages, what it can still learn, and how its added features compare to Scala's original ones.
Python 101++: Let's Get Down to Business!Paige Bailey
You've started the Codecademy and Coursera courses; you've thumbed through Zed Shaw's "Learn Python the Hard Way"; and now you're itching to see what Python can help you do. This is the workshop for you!
Here's the breakdown: we're going to be taking you on a whirlwind tour of Python's capabilities. By the end of the workshop, you should be able to easily follow any of the widely available Python courses on the internet, and have a grasp on some of the more complex aspects of the language.
Please don't forget to bring your personal laptop!
Audience: This course is aimed at those who already have some basic programming experience, either in Python or in another high level programming language (such as C/C++, Fortran, Java, Ruby, Perl, or Visual Basic). If you're an absolute beginner -- new to Python, and new to programming in general -- make sure to check out the "Python 101" workshop!
Those are the slides of the presentation we made with Maurice Naftalin à Goto: Copenhagen 2019.
Functional programmers have been saying for decades that they know the way to the future. Clearly they've been wrong, since imperative languages are still far more popular. Clearly they've also been right, as the advantages of functional programming have become increasingly obvious. Is it possible to combine the two models? Scala is one language that does this, and Java too has been on a journey, which still continues, of learning from functional languages and carefully adding features from them. In this talk, we'll review what Java has learned from functional languages, what it can still learn, and how its added features compare to Scala's original ones.
This presentation covers Python most important data structures like Lists, Dictionaries, Sets and Tuples. Exception Handling and Random number generation using simple python module "random" also covered. Added simple python programs at the end of the presentation
The slides of my JavaOne 2017 talk. It describes how you can create API using functional interfaces, default and static methods starting with Java 8. You can watch the video here: https://www.youtube.com/watch?v=64UO1YjVcZ0
The goal of this presentation is to broaden your knowledge of Python, exploring some concepts and techniques you might have never heard about. I won't go into too much detail, the goal is only to inspire you to research those features and patterns.
Busting the Field of Dreams Theory: Making Content Meaningful, Useful, and Fi...Blend Interactive
Content marketing requires a holistic strategy around your content to ensure it is visible to search engines without sacrificing its value to humans. Getting content noticed means creating high quality, useful content but publishing alone will not guarantee traffic, let alone conversions and sales. The work you put into planning before publishing is the best set-up for success. Strategy helps you choose the right message and content for your audiences, structure it for robots and readers, and promote it on multiple channels.
From the 2016 Now What? Conference: www.nowwhatconference.com
in this how the split() function work with string in python is discussed
TO DOWNLOAD MORE INFORMATION:
https://computerassignmentsforu.blogspot.com/p/stringinpythonsplit.html
VIDEO TUTORIAL LINK:
https://youtu.be/6BvslDmk1Z8
Ruby plays to many programming paradigms. It's an object-oriented language that can be used in a functional or an imperative/procedural way. But Ruby does not often get used as a logic programming language. In this talk I'll explore logic programming using Ruby. What is it, and is it a tool you want to add to your toolbox? We'll touch on several libraries, we'll primary look at an implementation of minikanren (http://minikanren.org/) for Ruby.
Presentation on using the Arrow library for enhanced Functional Programming in the Kotlin Language. Delivered at the Northern Ireland Developer Conference 2018.
Using the Arrow Library to increase the Functional Programming potential of the Kotlin Language. Presented to the Cork Java Users Group and Cork Functional Programmers on 1st May 2018
Slides from the talk we did with Maurice Naftalin for Devoxx Belgium 2019.
Functional programmers have been saying for decades that they know the way to the future.
Clearly they have been wrong, since imperative languages are still far more popular.
Clearly they have also been right, as the advantages of functional programming have become increasingly obvious. Is it possible to face both ways, and combine the two models?
Scala is one language that does this, and Java too has been on a journey, which still continues, of learning from functional languages and carefully adding features from them.
In this talk, we will review what Java has learned from functional languages, what it can still learn, and how its added features compare to Scala's original ones.
Python 101++: Let's Get Down to Business!Paige Bailey
You've started the Codecademy and Coursera courses; you've thumbed through Zed Shaw's "Learn Python the Hard Way"; and now you're itching to see what Python can help you do. This is the workshop for you!
Here's the breakdown: we're going to be taking you on a whirlwind tour of Python's capabilities. By the end of the workshop, you should be able to easily follow any of the widely available Python courses on the internet, and have a grasp on some of the more complex aspects of the language.
Please don't forget to bring your personal laptop!
Audience: This course is aimed at those who already have some basic programming experience, either in Python or in another high level programming language (such as C/C++, Fortran, Java, Ruby, Perl, or Visual Basic). If you're an absolute beginner -- new to Python, and new to programming in general -- make sure to check out the "Python 101" workshop!
Those are the slides of the presentation we made with Maurice Naftalin à Goto: Copenhagen 2019.
Functional programmers have been saying for decades that they know the way to the future. Clearly they've been wrong, since imperative languages are still far more popular. Clearly they've also been right, as the advantages of functional programming have become increasingly obvious. Is it possible to combine the two models? Scala is one language that does this, and Java too has been on a journey, which still continues, of learning from functional languages and carefully adding features from them. In this talk, we'll review what Java has learned from functional languages, what it can still learn, and how its added features compare to Scala's original ones.
This presentation covers Python most important data structures like Lists, Dictionaries, Sets and Tuples. Exception Handling and Random number generation using simple python module "random" also covered. Added simple python programs at the end of the presentation
The slides of my JavaOne 2017 talk. It describes how you can create API using functional interfaces, default and static methods starting with Java 8. You can watch the video here: https://www.youtube.com/watch?v=64UO1YjVcZ0
The goal of this presentation is to broaden your knowledge of Python, exploring some concepts and techniques you might have never heard about. I won't go into too much detail, the goal is only to inspire you to research those features and patterns.
Busting the Field of Dreams Theory: Making Content Meaningful, Useful, and Fi...Blend Interactive
Content marketing requires a holistic strategy around your content to ensure it is visible to search engines without sacrificing its value to humans. Getting content noticed means creating high quality, useful content but publishing alone will not guarantee traffic, let alone conversions and sales. The work you put into planning before publishing is the best set-up for success. Strategy helps you choose the right message and content for your audiences, structure it for robots and readers, and promote it on multiple channels.
From the 2016 Now What? Conference: www.nowwhatconference.com
Content Heavy Lifting: How to Recycle (and Upcycle) Your Content Over and Ove...Blend Interactive
We spend all this time building channels to house our content, but many of us are strapped for time and talent (sometimes treasure!) to keep the content production in high-gear. In this talk, Megan will walk through 10 ways to make one piece of content work across web, social and print to help you—or your clients—think creatively and strategically about making small amounts of content do the heavy-lifting across all your channels.
From the 2016 Now What? Conference: www.nowwhatconference.com
The Lone Ranger: Managing the Ups and Downs of One-Person Offices and Small T...Blend Interactive
The challenges of doing everything with less is increasingly difficult for all of us. In this talk, Ron will draw on years of experience in random outposts to uncover how he maximized the advantages and disadvantages of small-team life. You’ll also learn tactics for improving your own productivity in your own office.
From the 2016 Now What? Conference: www.nowwhatconference.com
“The Five Meetings You Meet in Web Design” by Kevin Hoffman (Now What? Confer...Blend Interactive
Web site building techniques are always changing, but the meetings supporting that work sadly haven’t changed much at all. At the core of every meeting is a group of human brains, and against the breakneck pace of iPhone model releases those brains have not evolved in the slightest. Better meeting design for web professionals addresses this constraint. Every web design organization has a core curriculum of five types of meeting goals: getting started, checking in, presenting, exploring, and the big finish. Each of the five meetings have classic mistakes, unique opportunities, best executions, and remote work implications. Kevin will explore how each of the five meetings is an opportunity to do your best work, with plenty of examples you can start using right away.
From the 2016 Now What? Conference: www.nowwhatconference.com
Next Level Collaboration: The Future of Content and Design by Rebekah Cancino...Blend Interactive
Imagine a future where siloed departments and legacy workflows don’t stand in our way. Today’s content is complex, interconnected, and needs to be ready for devices we haven’t even dreamed of yet. Tomorrow isn’t going to get any simpler. Successful outcomes demand a new kind of collaboration. For the past two years, Rebekah has studied how successful teams collaborate and has helped transform the way her team works and produces together. In this session, you’ll hear what she’s learned about making effective cross-discipline collaboration possible, and leave with actionable inspiration you can use to unite your team and workflow, too.
This talk will show you:
* What it takes to make effective collaboration possible
* How you can play a key role in creating the cross-discipline teams of tomorrow
* Practical tips you can use to bridge silos, increase productivity, and deliver better project outcomes for everyone
From the 2016 Now What? Conference: www.nowwhatconference.com
Reducing Digital Clutter: How to Clean Up the Back of Your House by Matt Groc...Blend Interactive
Organizations love to produce content, but the majority suck at making it available to internal resources and external audiences. In the race to provide more content for our audiences, we’ve created a systematic web of back-end digital clutter. In this talk, you’ll see how a cluttered internal content environment at a leading medical device company meant the difference between life and death. Fret not—we can fix this. Matthew will demonstrate how organizations in healthcare, technology, and financial services are cleaning up the back of their house, and how it has translated to richer content experiences for their audiences.
After this session, you will:
Understand the impact of fractured content on an organization
Establish an actionable plan to reduce digital clutter
Receive best practices on how content can be reused internally and externally
From the 2016 Now What? Conference: www.nowwhatconference.com
"The Self-Directed Strategist: Building a Practice and Managing Organizationa...Blend Interactive
There are two big parts to content strategy: the people, and the process. But there's a third one that presents some of the industry's biggest struggles: managing the space between people and process—especially in an organization that is new to content strategy. In this talk, we will discuss managing expectations, projects, and people—within small teams, among changing organizations, and with new clients.
“Writing for Your Audience — The Message, the Words, the Plan” – Business Sen...Blend Interactive
Every word has an audience. And every audience has a message. Tying those three things together, however, is what takes the act of writing into something more strategic. This talk will touch on determining audiences and message, and then dive into some basics on how to write and plan effective web content that is both on point and on time.
Lambda expressions have been introduced in Java 8 to support functional programming and enable behavior parameterization by passing functions as parameters to methods. The majority of software clones (duplicated code) are known to have behavioral differences (i.e., Type-2 and Type-3 clones). However, to the best of our knowledge, there is no previous work to investigate the utility of Lambda expressions for parameterizing such behavioral differences in clones. In this paper, we propose a technique that examines the applicability of Lambda expressions for the refactoring of clones with behavioral differences. Moreover, we empirically investigate the applicability and characteristics of the Lambda expressions introduced to refactor a large dataset of clones. Our findings show that Lambda expressions enable the refactoring of a significant portion of clones that could not be refactored by any other means.
Lambda Chops - Recipes for Simpler, More Expressive CodeIan Robertson
While the new Streams API has been a great showcase for lambda methods, there are many other ways this new language feature can be used to make friendlier APIs and more expressive code. Lambdas can be used for a number of tasks which historically required significant boilerplate, type-unsafe constructs, or both. From new ways to express metedata, to emulating Groovy's null-safe navigation operator, we'll take a look at a myriad of ways, big and small, that you can use lambdas to improve APIs and streamline your code. We'll also look at some of the limitations of lambdas, and some techniques for overcoming them.
Impala: A Modern, Open-Source SQL Engine for HadoopAll Things Open
All Things Open 2014 - Day 1
Wednesday, October 22nd, 2014
Ricky Saltzer
Software Engineer of Internal Tools for Cloudera
Big Data
Impala: A Modern, Open-Source SQL Engine for Hadoop
"The Accessible Editor Workshop" by Corey Vilhauer, from Now What? Workshops ...Blend Interactive
Your website's not just designed for your audiences: it's designed for everyone. Which means it needs to be accessible to everyone.
Often, accessibility falls into the hands of back- and front-end developers. But just as important is the ongoing maintenance of content within the CMS - the headings and images and alt tags and simple verbiage used to communicate your brand's message: a message that deserves to be seen and heard by everyone.
In this talk, we will dive into what we can do as editors to help fuel more accessible websites, separating the code from the content and making clear the responsibilities we all have in making sure the web is a better place for everyone.
"The Accessible Editor" by Corey Vilhauer, from DrupalCon 2018 in Nashville, ...Blend Interactive
Your website's not just designed for your audiences: it's designed for everyone. Which means it needs to be accessible to everyone.
Often, accessibility falls into the hands of back- and front-end developers. But just as important is the ongoing maintenance of content within the CMS - the headings and images and alt tags and simple verbiage used to communicate your brand's message: a message that deserves to be seen and heard by everyone.
In this talk, we will dive into what we can do as editors to help fuel more accessible websites, separating the code from the content and making clear the responsibilities we all have in making sure the web is a better place for everyone.
"Click to Continue" by Sam Otis, from Content+Design Meetup, Oct. 4, 2017Blend Interactive
Graphical interfaces help make powerful technology intuitive and accessible. They give us super powers. Join Sam Otis, Lead Designer at Blend Interactive, as the Sioux Falls Content + Design Group joins up with Sioux Falls Design Week for a fun look at how GUIs (Graphical User Interfaces) have developed, what makes an interface good today, and what challenges the future holds.
"Never Knowing Enough: dealing with the self doubt that hinders your success....Blend Interactive
From Karla Santi's presentation, ""Never Knowing Enough: dealing with the self doubt that hinders your success," given at the Sioux Falls Crossroads Summit 2017 in Sioux Falls, SD.
"Making things real: Content strategy for realistic content management" - Con...Blend Interactive
From Corey Vilhauer's workshop "Making things real: Content strategy for realistic content management" at Confab Intensive 2017 in Denver, Colorado.
Everyone has a plan. Until reality sets in.
You've seen it all before. A marketing team that's created unreasonable expectations. A designer who's looking to break barriers—without regard to the content model. The myth of personalization. The dangers of the completely customizable website.
And now it's your job to bridge the gap between dreams and usable web programming. How do we take what we want and translate it into something usable? How do we take someone's ideas and turn them into a usable web implementation, navigating the constraints and pitfalls of project dreams, organizational bias, and unrealistic expectations?
It's called "reification," and it's the act of making something real. We're not talking code. We're not talking CMS selection. We're simply talking about helping those we work with understand the content management landscape though a common language and practical questions. Let's take the best case scenario and get it closer to a real life scenario. Let's make things real.
"Making things real: Content strategy for realistic content management" - Con...Blend Interactive
From Confab Central 2017 in Minneapolis, Minnesota - June 8, 2017
Everyone has a plan. Until reality sets in.
You've done the interviews, and you’ve rallied the team, and now you have a dream. Here’s the thing: Your dream isn’t going to work. No dream ever does. Instead, your dream is going to cause disappointment and frustration, because it hasn’t been paired with the content management robots that will eventually serve and store your future website.
How do we prepare our dreams so they can function within the cold world of web programming? How do we help teams understand the reality of content management, and set expectations accordingly? How do we balance the rigidity of a content model with the creative flow of a marketing team? More than anything, how do we get everyone on the same page—from ideation to CMS help text?
It's called “reification,” and it's the act of making something real. We’re not talking code. We’re not talking CMS selection. We’re simply talking about helping those we work with understand the content management landscape through a common language and practical questions. Let’s take the best case scenario and get it closer to a real life scenario. Let's make things real.
In this session, you’ll learn how to:
* More effectively plan content projects for both the editors and the CMS.
* Balance the complexity of a content model with the talents and efficiencies of the editorial team.
* Account for structural needs while still maintaining discussion of messaging and overall branding.
* Better communicate how content models affect the final usability of the CMS.
Getting Started With User-Centered Content by Emileigh Barnes & Kate Garklavs...Blend Interactive
Writing for the web is messy and complicated. As web content managers, we must weigh user needs against stakeholder demands, tight timelines, budget constraints, and more. We’re often thrown into projects that are already underway or lack a clear strategy. Our work is constrained by organizational pressures.
In this workshop, we’ll talk about aligning content with project goals, creating a strategy that puts users first, and building products that can maintain momentum and success, even after we’re gone.
Content Measurement and Analytics: Making Positive Change on the Web by Rick ...Blend Interactive
We all want to create useful, usable content—and we want to deliver that content to the right users. But how do we know what works? And how do we use these insights to inform and adapt our content strategy? What does success look like?
Join us as we relate content goals to relevant and meaningful success metrics in order to quantitatively assess the quality of our web content and the efficacy of our content strategy. Say hello to positive change on the web!
Join us and learn to:
Translate strategic business objectives into measurable content goals
Find the right metrics for the right goals (and how to avoid misleading metrics
Measure and adapt your content strategy
Effectively present analytics data to engage content stakeholders and inform their work on the web
Configure Google Analytics to support your measurement plan
Rick Allen has worked on the web his entire career to help shape communications and content strategy. Rick is co-founder of Meet Content, an online resource aiming to empower higher education to create and sustain web content that works. As principal of ePublish Media, Inc., a content strategy consultancy in Boston, Mass., Rick partners with organizations big and small to drive and sustain bold goals.
“How Silos Learn: Working in the Idea Factory” by Amanda Costello - Now What?...Blend Interactive
Taking up the cry against organizational silos can bring both empathy and cringing. Of course, silos are awful and keep us from doing our best work, but when you’re in the middle of a silo – and maybe that silo is inside ANOTHER silo – well, what’s a website manager to do?
Based on her career among higher education’s ivory-tower silos, Amanda Costello brings together lessons from architecture and the Midwestern landscape to examine not only how to understand our silos, but to teach them a thing or two as well.
In 2017, “adaptive content” has become a buzzword. To some, it’s a complex, long-term initiative to structure content for flexible reuse and dynamic targeting. To others, it’s a way to ensure that everyone, everywhere, sees exactly what they want—like magic! In this talk, Karen shares her perspective (and reservations) on how adaptive content is being used today. She’ll discuss how adaptive content supports targeting content to device type—and why that’s rarely necessary. She’ll also describe ways that adaptive content can support tailoring content according to context—and ways that can go wrong. You’ll walk away with a better understanding of when adaptive content is necessary and how to get the most value from it.
"Empathy Behind the Algorithms" by Chris Corak - Now What? Conference 2017Blend Interactive
Search engine algorithms are always changing, it can feel impossible to keep up. But the goal behind every Google search result has always stayed the same—to give people exactly what they want and need. If that’s Google’s #1 goal, then why would we cater to search engines instead of working harder to make our audience happy? Great SEO that results in better visibility and higher conversions always maps back to the people behind the keywords. In this talk, Chris will show you practical SEO techniques and approaches you can use to make sure your content is helpful, relevant, and findable, too.
“The Beauty of Brevity” by Ravi Jain - Now What? Conference 2017Blend Interactive
The temptation with video content is to do too much: too many stories, too many voices, too many seconds! Parsing a bigger message into smaller bites offers a flexibility to align with an integrated marketing strategy. But it’s not about speeding things up or cutting things out.
Utilizing short form content effectively takes foresight, contingency planning and conceptual agility. In this session, Ravi Jain will walk through the creative process of harnessing the potential of short- form aggregate storytelling.
“Why Content Projects Fail” by Deane Barker - Now What? Conference 2017Blend Interactive
The content management implementation failure rate is higher than it should be, and projects seem to fail for the same cluster of reasons: unrealistic requirements, expectations, human factors, etc. In this session, Deane will discuss the major reasons for project failure learned through almost two decades of implementation experience, and discuss strategies and policies to put in place at each stage of the project to prevent them.
Not Perfect, "Always Better: A Story of Inclusion" by Derek Featherstone - No...Blend Interactive
Jake walked out of the conference room after meeting with Claire (VP of Engineering) and Sanjay (Design Director). He almost felt their glare burning a hole through his shirt. Jake had just sat through a hour-long meeting reviewing the user feedback from last year’s site launch. There had been reports of some accessibility issues for some time, but they’d been mostly ignored. The picture wasn’t getting any better: they were missing out on a lot of potential revenue by being hostile to people with disabilities.
Jake pulled out his phone and sent a message to his team in Slack. “We’ve got some work to do”
What was his next move? How did he begin the work and start to prioritize what needed to be done? How did he change the team’s process to include accessibility in EVERY post launch plan? Check in with Derek to find out what Jake and his team did next; you’ll learn what you need to do after a site launch to ensure your site is both accessible and easy to use by people with disabilities… and stays that way.
Content Design for Mobile Devices - Now What? Conference 2017Blend Interactive
We’ve all been so focused on designing for mobile devices that we’ve forgotten about content. But how your customers find, consume, and share your content on mobile is more important than ever. Learn about how to use content strategy to solve these issues, including content modeling, content auditing, and the core model. It may sound super nerdy now, but it won’t be once you’re there.
"Making Things Real: Taking content strategy from abstract to functional" - M...Blend Interactive
From MinneWebCon 2017 in Minneapolis, Minnesota - May 1, 2017
Everyone has a plan. Until reality sets in.
You've done the interviews, and you've rallied the team, and now you have a dream. Here's the thing: Your dream isn't going to work. No dream ever does. Instead, your dream is going to cause disappointment and frustration, because it hasn't been paired with the content management robots that will eventually serve and store your future website.
How do we prepare our dreams so they can function within the cold world of web programming? How do we take what we want and translate it into something usable? How do we take someone's ideas and turn them into a usable web implementation, navigating the constraints and pitfalls of project dreams, organizational bias, and unrealistic expectations?
It's called "reification," and it's the act of making something real. We're not talking code. We're not talking CMS selection. We're simply talking about helping those we work with understand the content management landscape though a common language and practical questions. Let's take the best case scenario and get it closer to a real life scenario. Let's make things real.
"Small CS: A Shoestring Approach to Content Strategy" by Corey Vilhauer at Co...Blend Interactive
"Small CS: A Shoestring Approach to Content Strategy," a talk about making content strategy smaller, more accessible, and easier for small teams. Given by Corey Vilhauer at Confab Higher Ed 2015 in New Orleans, LA.
Introducing the Blend Web Operations Framework by Deane Barker (Now What? Con...Blend Interactive
Effective web operations is often treated as something of a minor miracle — we’re not sure how it gets done, but we stumble through it somehow. In a long-range attempt to remedy this, Blend Interactive is developing a formal “Web Operations Framework,” describing the roles, tasks, events, and artifacts to implement effective web strategy in your own operations. Deane will give a short introduction to this framework, both its current form and where it’s going. Additionally, Deane will discuss how this framework will affect the curriculum of the Now What? conference in the coming years.
Living With Agile by Karl Fast (Now What? Conference 2015)Blend Interactive
Agile is the modern way of making software. It’s the new standard for managing IT development teams and projects. But while Agile is centered on developers, setting the course for your website depends on many different roles: project managers, content strategists, information architects, marketing specialists, and more. What does Agile mean for everyone else? Developers are learning how to be Agile. The rest of us must learn how to live with Agile. Find out how.
Integrating Accessibility: Planning Content for Everyone by Eileen Webb (Now ...Blend Interactive
Discussions about web accessibility are usually focused on the technical challenges, but the real roadblocks are often inside your organization. Editors don’t know the steps to creating accessible content, and managers don’t understand the need. You may have a technically-accessible site, but you don’t have the workflow to fill it. We’ll talk about the organizational changes necessary to support complete content accessibility, from executive persuasion techniques to nitty-gritty process planning. Some organizations can be motivated by a carrot, while others will need the stick.
A full transcript is available at http://webmeadow.com/blog/archives/201505/integrating-accessibility-planning-content-everyone.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
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.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
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
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.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
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.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
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
4. What this talk is
A gentle introduction to functional
paradigms using a language you may
already be familiar with.
A comparison between OOP and
functional styles
A discussion on language expectations
5. What this talk
isn’t
“OOP is dead!”
“Functional all the things!”
“All code should look exactly like
this!” (Spoiler: it probably shouldn’t)
6. Who I am
Bob Davidson
C# / Web Developer 11 years
Blend Interactive
A guy who is generally interested in
and learning about functional
programming concepts
https://github.com/mrdrbob
7. Who I am Not
A functional programming expert who
says things like:
“All told, a monad in X is just a
monoid in the category of
endofunctors of X, with product ×
replaced by composition of
endofunctors and unit set by the
identity endofunctor.”
-Saunders Mac Lane
8. Let’s Build a Parser!
A highly simplified JSON-like syntax for strings and integers.
13. IntegerParser
public class IntegerParser : IParser<int> {
public bool TryParse(string raw, out int value) {
value = 0;
int x = 0;
List<char> buffer = new List<char>();
while (x < raw.Length && char.IsDigit(raw[x])) {
buffer.Add(raw[x]);
x += 1;
}
if (x == 0)
return false;
// Deal with it.
value = int.Parse(new string(buffer.ToArray()));
return true;
}
}
14. IntegerParser
public class IntegerParser : IParser<int> {
public bool TryParse(string raw, out int value) {
value = 0;
int x = 0;
List<char> buffer = new List<char>();
while (x < raw.Length && char.IsDigit(raw[x])) {
buffer.Add(raw[x]);
x += 1;
}
if (x == 0)
return false;
value = int.Parse(new string(buffer.ToArray()));
return true;
}
}
15. StringParser
public class StringParser : IParser<string> {
public bool TryParse(string raw, out string value) {
value = null;
int x = 0;
if (x == raw.Length || raw[x] != '"')
return false;
x += 1;
List<char> buffer = new List<char>();
while (x < raw.Length && raw[x] != '"') {
if (raw[x] == '') {
x += 1;
if (x == raw.Length)
return false;
if (raw[x] == '')
buffer.Add(raw[x]);
else if (raw[x] == '"')
buffer.Add(raw[x]);
else
return false;
} else {
buffer.Add(raw[x]);
}
x += 1;
}
if (x == raw.Length)
return false;
x += 1;
value = new string(buffer.ToArray());
return true;
}
}
16. Possible Issues
public class StringParser : IParser<string> {
public bool TryParse(string raw, out string value) {
value = null;
int x = 0;
if (x == raw.Length || raw[x] != '"')
return false;
x += 1;
List<char> buffer = new List<char>();
while (x < raw.Length && raw[x] != '"') {
if (raw[x] == '') {
x += 1;
if (x == raw.Length)
return false;
if (raw[x] == '')
buffer.Add(raw[x]);
else if (raw[x] == '"')
buffer.Add(raw[x]);
else
return false;
} else {
buffer.Add(raw[x]);
}
x += 1;
}
if (x == raw.Length)
return false;
x += 1;
value = new string(buffer.ToArray());
return true;
}
}
Repeated checks against
running out of input
Easily missed logic for
moving input forward
No way to see how much
input was consumed / how
much is left
Hard to understand at a
glance what is happening
public class IntegerParser : IParser<int> {
public bool TryParse(string raw, out int value) {
value = 0;
int x = 0;
List<char> buffer = new List<char>();
while (x < raw.Length && char.IsDigit(raw[x])) {
buffer.Add(raw[x]);
x += 1;
}
if (x == 0)
return false;
// Deal with it.
value = int.Parse(new string(buffer.ToArray()));
return true;
}
}
17. Rethinking the Parser
Make a little more generic / reusable
Break the process down into a series of rules which can be composed to make new
parsers from existing parsers
Build a framework that doesn’t rely on strings, but rather a stream of tokens
21. Ignore Latter
Keep Latter
Zero or More Times
Any of these
NotKeep Latter
A Parser Built on Rules (String Parser)
“
“
Keep Latter
Any of these
“
“
22. A Set of Rules
Match Quote
Match Slash
Match Digit
Match Then Keep
Match Then Ignore
Match Any
Match Zero or More Times
Match One or More Times
Not
23. Rethinking the Source
Handle tokens other than chars (such as byte streams, pre-lexed tokens, etc)
Need the ability to continue parsing after a success
Need the ability to reset after a failure
24. Rethinking the Source
public interface ISource<Token> {
Token Current { get; }
bool HasMore { get; }
int CurrentIndex { get; }
void Move(int index);
}
public class StringSource : ISource<char> {
readonly string value;
int index;
public StringSource(string value) { this.value = value; }
public char Current => value[index];
public int CurrentIndex => index;
public bool HasMore => index < value.Length;
public void Move(int index) => this.index = index;
}
25. Creating a Rule
public interface IRule<Token, TResult> {
bool TryParse(ISource<Token> source, out TResult result);
}
26. Char Matches...
public class CharIsQuote : IRule<char, char> {
public bool TryParse(ISource<char> source, out
char result) {
result = default(char);
if (!source.HasMore)
return false;
if (source.Current != '"')
return false;
result = source.Current;
source.Move(source.CurrentIndex + 1);
return true;
}
}
public class CharIs : IRule<char, char> {
readonly char toMatch;
public CharIs(char toMatch) { this.toMatch =
toMatch; }
public bool TryParse(ISource<char> source, out char
result) {
result = default(char);
if (!source.HasMore)
return false;
if (source.Current != toMatch)
return false;
result = source.Current;
source.Move(source.CurrentIndex + 1);
return true;
}
}
27. Char Matches...
public abstract class CharMatches : IRule<char, char> {
protected abstract bool IsCharMatch(char c);
public bool TryParse(ISource<char> source, out char result) {
result = default(char);
if (!source.HasMore)
return false;
if (!IsCharMatch(source.Current))
return false;
result = source.Current;
source.Move(source.CurrentIndex + 1);
return true;
}
}
public class CharIsDigit : CharMatches {
protected override bool IsCharMatch(char c) => char.IsDigit(c);
}
public class CharIs : CharMatches {
readonly char toMatch;
public CharIs(char toMatch) { this.toMatch = toMatch; }
protected override bool IsCharMatch(char c) => c == toMatch;
}
28. First Match (or Any)
public class FirstMatch<Token, TResult> : IRule<Token, TResult> {
readonly IRule<Token, TResult>[] rules;
public FirstMatch(IRule<Token, TResult>[] rules) { this.rules = rules; }
public bool TryParse(ISource<Token> source, out TResult result) {
foreach(var rule in rules) {
int originalIndex = source.CurrentIndex;
if (rule.TryParse(source, out result))
return true;
source.Move(originalIndex);
}
result = default(TResult);
return false;
}
}
29. Match Then... public abstract class MatchThen<Token, TLeft, TRight, TOut> : IRule<Token, TOut> {
readonly IRule<Token, TLeft> leftRule;
readonly IRule<Token, TRight> rightRule;
protected abstract TOut Combine(TLeft leftResult, TRight rightResult);
public MatchThen(IRule<Token, TLeft> leftRule, IRule<Token, TRight> rightRule) {
this.leftRule = leftRule;
this.rightRule = rightRule;
}
public bool TryParse(ISource<Token> source, out TOut result) {
int originalIndex = source.CurrentIndex;
result = default(TOut);
TLeft leftResult;
if (!leftRule.TryParse(source, out leftResult)) {
source.Move(originalIndex);
return false;
}
TRight rightResult;
if (!rightRule.TryParse(source, out rightResult)) {
source.Move(originalIndex);
return false;
}
result = Combine(leftResult, rightResult);
return true;
}
}
30. Match Then...
public class MatchThenKeep<Token, TLeft, TRight> : MatchThen<Token, TLeft, TRight, TRight> {
public MatchThenKeep(IRule<Token, TLeft> leftRule, IRule<Token, TRight> rightRule) : base(leftRule, rightRule) { }
protected override TRight Combine(TLeft leftResult, TRight rightResult) => rightResult;
}
public class MatchThenIgnore<Token, TLeft, TRight> : MatchThen<Token, TLeft, TRight, TLeft> {
public MatchThenIgnore(IRule<Token, TLeft> leftRule, IRule<Token, TRight> rightRule) : base(leftRule, rightRule) { }
protected override TLeft Combine(TLeft leftResult, TRight rightResult) => leftResult;
}
31. Invert Rule (Not)
public class Not<Token, TResult> : IRule<Token, Token> {
readonly IRule<Token, TResult> rule;
public Not(IRule<Token, TResult> rule) { this.rule = rule; }
public bool TryParse(ISource<Token> source, out Token result) {
result = default(Token);
if (!source.HasMore)
return false;
int originalIndex = source.CurrentIndex;
TResult throwAwayResult;
bool matches = rule.TryParse(source, out throwAwayResult);
if (matches)
{
source.Move(originalIndex);
return false;
}
source.Move(originalIndex);
result = source.Current;
source.Move(originalIndex + 1);
return true;
}
}
Spot the bug!
32. Many (Once, Zero, and more times)
public class Many<Token, TResult> : IRule<Token, TResult[]> {
readonly IRule<Token, TResult> rule;
readonly bool requireAtLeastOne;
public Many(IRule<Token, TResult> rule, bool requireAtLeastOne) { this.rule = rule; this.requireAtLeastOne = requireAtLeastOne; }
public bool TryParse(ISource<Token> source, out TResult[] results) {
List<TResult> buffer = new List<TResult>();
while (source.HasMore) {
int originalIndex = source.CurrentIndex;
TResult result;
bool matched = rule.TryParse(source, out result);
if (!matched) {
source.Move(originalIndex);
break;
}
buffer.Add(result);
}
if (requireAtLeastOne && buffer.Count == 0) {
results = null;
return false;
}
results = buffer.ToArray();
return true;
}
}
33. Map Result
public abstract class MapTo<Token, TIn, TOut> : IRule<Token, TOut> {
readonly IRule<Token, TIn> rule;
protected MapTo(IRule<Token, TIn> rule) { this.rule = rule; }
protected abstract TOut Convert(TIn value);
public bool TryParse(ISource<Token> source, out TOut result) {
result = default(TOut);
int originalIndex = source.CurrentIndex;
TIn resultIn;
if (!rule.TryParse(source, out resultIn)) {
source.Move(originalIndex);
return false;
}
result = Convert(resultIn);
return true;
}
}
34. Map Result
public class JoinText : MapTo<char, char[], string> {
public JoinText(IRule<char, char[]> rule) : base(rule) { }
protected override string Convert(char[] value) => new string(value);
}
public class MapToInteger : MapTo<char, string, int> {
public MapToInteger(IRule<char, string> rule) : base(rule) { }
protected override int Convert(string value) => int.Parse(value);
}
35. Putting the blocks together
var quote = new CharIs('"');
var slash = new CharIs('');
var escapedQuote = new MatchThenKeep<char, char, char>(slash, quote);
var escapedSlash = new MatchThenKeep<char, char, char>(slash, slash);
var notQuote = new Not<char, char>(quote);
var insideQuoteChar = new FirstMatch<char, char>(new[] {
(IRule<char, char>)escapedQuote,
escapedSlash,
notQuote
});
var insideQuote = new Many<char, char>(insideQuoteChar, false);
var insideQuoteAsString = new JoinText(insideQuote);
var openQuote = new MatchThenKeep<char, char, string>(quote,
insideQuoteAsString);
var fullQuote = new MatchThenIgnore<char, string, char>(openQuote, quote);
var source = new StringSource(raw);
string asQuote;
if (fullQuote.TryParse(source, out asQuote))
return asQuote;
source.Move(0);
int asInteger;
if (digitsAsInt.TryParse(source, out asInteger))
return asInteger;
return null;
var digit = new CharIsDigit();
var digits = new Many<char, char>(digit, true);
var digitsString = new JoinText(digits);
var digitsAsInt = new MapToInteger(digitsString);
43. An Immutable Source
public interface ISource<Token> {
Token Current { get; }
bool HasMore { get; }
int CurrentIndex { get; }
void Move(int index);
}
public interface ISource<Token> {
Token Current { get; }
bool HasMore { get; }
ISource<Token> Next();
}
44. An Immutable Source
public class StringSource : ISource<char> {
readonly string value;
int index;
public StringSource(string value) {
this.value = value; }
public char Current => value[index];
public int CurrentIndex => index;
public bool HasMore => index < value.Length;
public void Move(int index) => this.index = index;
}
public class StringSource : ISource<char> {
readonly string value;
readonly int index;
public StringSource(string value, int index = 0) {
this.value = value; this.index = index; }
public char Current => value[index];
public bool HasMore => index < value.Length;
public ISource<char> Next() =>
new StringSource(value, index + 1);
}
45. Ditch the Out
public class Result<Token, TValue> {
public bool Success { get; }
public TValue Value { get; }
public string Message { get; }
public ISource<Token> Next { get; }
public Result(bool success, TValue value, string message, ISource<Token> next) {
Success = success;
Value = value;
Message = message;
Next = next;
}
}
public interface IRule<Token, TValue> {
Result<Token, TValue> TryParse(ISource<Token> source);
}
46. Char Matches...
public abstract class CharMatches : IRule<char, char> {
protected abstract bool IsCharMatch(char c);
public bool TryParse(ISource<char> source, out char result) {
result = default(char);
if (!source.HasMore)
return false;
if (!IsCharMatch(source.Current))
return false;
result = source.Current;
source.Move(source.CurrentIndex + 1);
return true;
}
}
public abstract class CharMatches : IRule<char, char> {
protected abstract bool IsCharMatch(char c);
public Result<char, char> TryParse(ISource<char> source) {
if (!source.HasMore)
return new Result<char, char>(false, '0', "Unexpected EOF", null);
if (!IsCharMatch(source.Current))
return new Result<char, char>(false, '0', $"Unexpected char: {source.Current}", null);
return new Result<char, char>(true, source.Current, null, source.Next());
}
}
47. These Don’t Change
public class CharIsDigit : CharMatches {
protected override bool IsCharMatch(char c) => char.IsDigit(c);
}
public class CharIs : CharMatches {
readonly char toMatch;
public CharIs(char toMatch) { this.toMatch = toMatch; }
protected override bool IsCharMatch(char c) => c == toMatch;
}
48. First Match
public class FirstMatch<Token, TResult> : IRule<Token, TResult> {
readonly IRule<Token, TResult>[] rules;
public FirstMatch(IRule<Token, TResult>[] rules) { this.rules = rules; }
public bool TryParse(ISource<Token> source, out TResult result) {
foreach(var rule in rules) {
int originalIndex = source.CurrentIndex;
if (rule.TryParse(source, out result))
return true;
source.Move(originalIndex);
}
result = default(TResult);
return false;
}
}
public class FirstMatch<Token, TResult> : IRule<Token, TResult> {
readonly IRule<Token, TResult>[] rules;
public FirstMatch(IRule<Token, TResult>[] rules) { this.rules = rules; }
public Result<Token, TResult> TryParse(ISource<Token> source) {
foreach (var rule in rules) {
var result = rule.TryParse(source);
if (result.Success)
return result;
}
return new Result<Token, TResult>(false, default(TResult), "No rule matched", null);
}
}
49. Match Then...
public bool TryParse(ISource<Token> source, out TOut result) {
int originalIndex = source.CurrentIndex;
result = default(TOut);
TLeft leftResult;
if (!leftRule.TryParse(source, out leftResult)) {
source.Move(originalIndex);
return false;
}
TRight rightResult;
if (!rightRule.TryParse(source, out rightResult)) {
source.Move(originalIndex);
return false;
}
result = Combine(leftResult, rightResult);
return true;
}
public Result<Token, TOut> TryParse(ISource<Token> source) {
var leftResult = leftRule.TryParse(source);
if (!leftResult.Success)
return new Result<Token, TOut>(false, default(TOut), leftResult.Message, null);
var rightResult = rightRule.TryParse(leftResult.Next);
if (!rightResult.Success)
return new Result<Token, TOut>(false, default(TOut), rightResult.Message, null);
var result = Combine(leftResult.Value, rightResult.Value);
return new Result<Token, TOut>(true, result, null, rightResult.Next);
}
50. Invert Rule (Not)
public class Not<Token, TResult> : IRule<Token, Token> {
readonly IRule<Token, TResult> rule;
public Not(IRule<Token, TResult> rule) { this.rule = rule; }
public bool TryParse(ISource<Token> source, out Token result) {
result = default(Token);
if (!source.HasMore)
return false;
int originalIndex = source.CurrentIndex;
TResult throwAwayResult;
bool matches = rule.TryParse(source, out throwAwayResult);
if (matches)
{
source.Move(originalIndex);
return false;
}
source.Move(originalIndex);
result = source.Current;
source.Move(originalIndex + 1);
return true;
}
}
public class Not<Token, TResult> : IRule<Token, Token> {
readonly IRule<Token, TResult> rule;
public Not(IRule<Token, TResult> rule) { this.rule = rule; }
public Result<Token, Token> TryParse(ISource<Token> source) {
if (!source.HasMore)
return new Result<Token, Token>(false, default(Token), "Unexpected
EOF", null);
var result = rule.TryParse(source);
if (result.Success)
return new Result<Token, Token>(false, default(Token), "Unexpected
match", null);
return new Result<Token, Token>(true, source.Current, null,
source.Next());
}
}
52. Still Room for Improvement
public class Result<Token, TValue> {
public bool Success { get; }
public TValue Value { get; }
public string Message { get; }
public ISource<Token> Next { get; }
public Result(bool success, TValue value, string message, ISource<Token> next) {
Success = success;
Value = value;
Message = message;
Next = next;
}
}
Only valid when Success = true
Only valid when Success = false
54. Two States (Simple “Result” Example)
public interface IResult { }
public class SuccessResult<TValue> : IResult {
public TValue Value { get; }
public SuccessResult(TValue value) { Value = value; }
}
public class ErrorResult : IResult {
public string Message { get; }
public ErrorResult(string message) { Message = message; }
}
55. Two States (The Matching)
IResult result = ParseIt();
if (result is SuccessResult<string>) {
var success = (SuccessResult<string>)result;
Console.WriteLine($"SUCCESS: {success.Value}");
} else if (result is ErrorResult) {
var error = (ErrorResult)result;
Console.WriteLine($"ERR: {error.Message}");
}
56. Pattern Matching(ish)
public interface IResult<TValue> {
T Match<T>(Func<SuccessResult<TValue>, T> success,
Func<ErrorResult<TValue>, T> error);
}
public class SuccessResult<TValue> : IResult<TValue> {
public TValue Value { get; }
public SuccessResult(TValue value) { Value = value; }
public T Match<T>(Func<SuccessResult<TValue>, T> success,
Func<ErrorResult<TValue>, T> error) => success(this);
}
public class ErrorResult<TValue> : IResult<TValue>
{
public string Message { get; }
public ErrorResult(string message) { Message = message; }
public T Match<T>(Func<SuccessResult<TValue>, T> success,
Func<ErrorResult<TValue>, T> error) => error(this);
}
57. Pattern Matching(ish)
IResult<string> result = ParseIt();
string message = result.Match(
success => $"SUCCESS: ${success.Value}",
error => $"ERR: {error.Message}");
Console.WriteLine(message);
IResult result = ParseIt();
if (result is SuccessResult<string>) {
var success = (SuccessResult<string>)result;
Console.WriteLine($"SUCCESS: {success.Value}");
} else if (result is ErrorResult) {
var error = (ErrorResult)result;
Console.WriteLine($"ERR: {error.Message}");
}
58. The Match
Method
Forces us to handle all cases
Gives us an object with only valid
properties for that state
59. The New IResult
public interface IResult<Token, TValue> {
T Match<T>(Func<FailResult<Token, TValue>, T> fail,
Func<SuccessResult<Token, TValue>, T> success);
}
public class FailResult<Token, TValue> : IResult<Token, TValue> {
public string Message { get; }
public FailResult(string message) { Message = message; }
public T Match<T>(Func<FailResult<Token, TValue>, T> fail,
Func<SuccessResult<Token, TValue>, T> success) => fail(this);
}
public class SuccessResult<Token, TValue> : IResult<Token, TValue> {
public TValue Value { get; }
public ISource<Token> Next { get; }
public SuccessResult(TValue value, ISource<Token> next) { Value = value; Next = next; }
public T Match<T>(Func<FailResult<Token, TValue>, T> fail,
Func<SuccessResult<Token, TValue>, T> success) => success(this);
}
60. ISource also Represents Two States
public interface ISource<Token> {
Token Current { get; }
bool HasMore { get; }
ISource<Token> Next();
}
Only valid when HasMore = true
61. The New ISource
public interface ISource<Token> {
T Match<T>(Func<EmtySource<Token>, T> empty,
Func<SourceWithMoreContent<Token>, T> hasMore);
}
public class EmtySource<Token> : ISource<Token> {
// No properties! No state! Let's just make it singleton.
EmtySource() { }
public static readonly EmtySource<Token> Instance = new EmtySource<Token>();
public T Match<T>(Func<EmtySource<Token>, T> empty,
Func<SourceWithMoreContent<Token>, T> hasMore) => empty(this);
}
public class SourceWithMoreContent<Token> : ISource<Token> {
readonly Func<ISource<Token>> getNext;
public SourceWithMoreContent(Token current, Func<ISource<Token>> getNext) { Current = current; this.getNext = getNext; }
public Token Current { get; set; }
public ISource<Token> Next() => getNext();
public T Match<T>(Func<EmtySource<Token>, T> empty,
Func<SourceWithMoreContent<Token>, T> hasMore) => hasMore(this);
}
62. Make a String Source
public static class StringSource {
public static ISource<char> Create(string value, int index = 0) {
if (index >= value.Length)
return EmtySource<char>.Instance;
return new SourceWithMoreContent<char>(value[index], () => Create(value, index + 1));
}
}
public static ISource<char> Create(string value, int index = 0)
=> index >= value.Length
? (ISource<char>)EmtySource<char>.Instance
: new SourceWithMoreContent<char>(value[index], () => Create(value, index + 1));
63. Char Matches... public abstract class CharMatches : IRule<char, char> {
protected abstract bool IsCharMatch(char c);
public Result<char, char> TryParse(ISource<char> source) {
if (!source.HasMore)
return new Result<char, char>(false, '0', "Unexpected EOF", null);
if (!IsCharMatch(source.Current))
return new Result<char, char>(false, '0', $"Unexpected char: {source.Current}", null);
return new Result<char, char>(true, source.Current, null, source.Next());
}
}
public abstract class CharMatches : IRule<char, char> {
protected abstract bool IsCharMatch(char c);
public IResult<char, char> TryParse(ISource<char> source) {
var result = source.Match(
empty => (IResult<char, char>)new FailResult<char, char>("Unexpected EOF"),
hasMore =>
{
if (!IsCharMatch(hasMore.Current))
return new FailResult<char, char>($"Unexpected char: {hasMore.Current}");
return new SuccessResult<char, char>(hasMore.Current, hasMore.Next());
});
return result;
}
}
public IResult<char, char> TryParse(ISource<char> source)
=> source.Match(
empty => new FailResult<char, char>("Unexpected EOF"),
hasMore => IsCharMatch(hasMore.Current)
? new SuccessResult<char, char>(hasMore.Current, hasMore.Next())
: (IResult<char, char>)new FailResult<char, char>($"Unexpected char: {hasMore.Current}")
);
64. Match Then...
public IResult<Token, TOut> TryParse(ISource<Token> source) {
var leftResult = leftRule.TryParse(source);
var finalResult = leftResult.Match(
leftFail => new FailResult<Token, TOut>(leftFail.Message),
leftSuccess => {
var rightResult = rightRule.TryParse(leftSuccess.Next);
var rightFinalResult = rightResult.Match(
rightFail => (IResult<Token, TOut>)new FailResult<Token, TOut>(rightFail.Message),
rightSuccess => {
var finalValue = Combine(leftSuccess.Value, rightSuccess.Value);
return new SuccessResult<Token, TOut>(finalValue, rightSuccess.Next);
});
return rightFinalResult;
});
return finalResult;
}
public Result<Token, TOut> TryParse(ISource<Token> source) {
var leftResult = leftRule.TryParse(source);
if (!leftResult.Success)
return new Result<Token, TOut>(false, default(TOut), leftResult.Message, null);
var rightResult = rightRule.TryParse(leftResult.Next);
if (!rightResult.Success)
return new Result<Token, TOut>(false, default(TOut), rightResult.Message, null);
var result = Combine(leftResult.Value, rightResult.Value);
return new Result<Token, TOut>(true, result, null, rightResult.Next);
}
public IResult<Token, TOut> TryParse(ISource<Token> source)
=> leftRule.TryParse(source).Match(
leftFail => new FailResult<Token, TOut>(leftFail.Message),
leftSuccess =>
rightRule.TryParse(leftSuccess.Next).Match(
rightFail => (IResult<Token, TOut>)new FailResult<Token, TOut>(rightFail.Message),
rightSuccess => new SuccessResult<Token, TOut>(Combine(leftSuccess.Value, rightSuccess.Value),
rightSuccess.Next)
)
);
65. Invert Rule (Not)
public Result<Token, Token> TryParse(ISource<Token> source) {
if (!source.HasMore)
return new Result<Token, Token>(false, default(Token), "Unexpected EOF", null);
var result = rule.TryParse(source);
if (result.Success)
return new Result<Token, Token>(false, default(Token), "Unexpected match", null);
return new Result<Token, Token>(true, source.Current, null, source.Next());
}
public IResult<Token, Token> TryParse(ISource<Token> source)
=> source.Match(
empty => new FailResult<Token, Token>("Unexpected EOF"),
current => rule.TryParse(current).Match(
fail => new SuccessResult<Token, Token>(current.Current, current.Next()),
success => (IResult<Token, Token>)new FailResult<Token, Token>("Unexpected match")
)
);
67. Let’s Be Honest
All these `new` objects are ugly.
var quote = new CharIs('"');
var slash = new CharIs('');
var escapedQuote = new MatchThenKeep<char, char,
char>(slash, quote);
var escapedSlash = new MatchThenKeep<char, char,
char>(slash, slash);
var notQuote = new Not<char, char>(quote);
var insideQuoteChar = new FirstMatch<char, char>(new[] {
(IRule<char, char>)escapedQuote,
escapedSlash,
notQuote
});
var insideQuote = new Many<char, char>(insideQuoteChar,
false);
var insideQuoteAsString = new JoinText(insideQuote);
var openQuote = new MatchThenKeep<char, char,
string>(quote, insideQuoteAsString);
var fullQuote = new MatchThenIgnore<char, string,
char>(openQuote, quote);
68. Also
Single method interfaces are lame*.
It’s effectively a delegate.
public interface IRule<Token, TValue> {
IResult<Token, TValue> TryParse(ISource<Token> source);
}
*In a non-scientific poll of people who agree with me, 100% of
respondents confirmed this statement. Do not question its validity.
70. A Rule is a Delegate is a Function
public interface IRule<Token, TValue> {
IResult<Token, TValue> TryParse(ISource<Token> source);
}
public delegate IResult<Token, TValue> Rule<Token, TValue>(ISource<Token> source);
71. Char Matches...
public abstract class CharMatches : IRule<char, char> {
protected abstract bool IsCharMatch(char c);
public IResult<char, char> TryParse(ISource<char> source)
=> source.Match(
empty => new FailResult<char, char>("Unexpected EOF"),
hasMore => IsCharMatch(hasMore.Current)
? new SuccessResult<char, char>(hasMore.Current, hasMore.Next())
: (IResult<char, char>)new FailResult<char, char>($"Unexpected char: {hasMore.Current}")
);
}
public static class Rules {
public static Rule<char, char> CharMatches(Func<char, bool> isMatch)
=> (source) => source.Match(
empty => new FailResult<char, char>("Unexpected EOF"),
hasMore => isMatch(hasMore.Current)
? new SuccessResult<char, char>(hasMore.Current, hasMore.Next())
: (IResult<char, char>)new FailResult<char, char>($"Unexpected char: {hasMore.Current}")
);
}
public static Rule<char, char> CharIsDigit() => CharMatches(char.IsDigit);
public static Rule<char, char> CharIs(char c) => CharMatches(x => x == c);
74. Example Usage
var quote = Rules.CharIs('"');
var slash = Rules.CharIs('');
var escapedQuote = Rules.MatchThenKeep(slash, quote);
var escapedSlash = slash.MatchThenKeep(slash);
75. The Original 2.0 Definition
var quote = new CharIs('"');
var slash = new CharIs('');
var escapedQuote = new MatchThenKeep<char, char, char>(slash, quote);
var escapedSlash = new MatchThenKeep<char, char, char>(slash, slash);
var notQuote = new Not<char, char>(quote);
var insideQuoteChar = new FirstMatch<char, char>(new[] {
(IRule<char, char>)escapedQuote,
escapedSlash,
notQuote
});
var insideQuote = new Many<char, char>(insideQuoteChar, false);
var insideQuoteAsString = new JoinText(insideQuote);
var openQuote = new MatchThenKeep<char, char, string>(quote,
insideQuoteAsString);
var fullQuote = new MatchThenIgnore<char, string, char>(openQuote, quote);
var source = new StringSource(raw);
string asQuote;
if (fullQuote.TryParse(source, out asQuote))
return asQuote;
source.Move(0);
int asInteger;
if (digitsAsInt.TryParse(source, out asInteger))
return asInteger;
return null;
var digit = new CharIsDigit();
var digits = new Many<char, char>(digit, true);
var digitsString = new JoinText(digits);
var digitsAsInt = new MapToInteger(digitsString);
76. The Updated 3.0 Definition
var quote = Rules.CharIs('"');
var slash = Rules.CharIs('');
var escapedQuote = slash.MatchThenKeep(quote);
var escapedSlash = slash.MatchThenKeep(slash);
var notQuote = quote.Not();
var fullQuote = quote
.MatchThenKeep(
Rules.FirstMatch(
escapedQuote,
escapedSlash,
notQuote
).Many().JoinText()
)
.MatchThenIgnore(quote);
var finalResult = Rules.FirstMatch(
fullQuote.MapTo(x => (object)x),
digit.MapTo(x => (object)x)
);
var source = StringSource.Create(raw);
return finalResult(source).Match(
fail => null,
success => success.Value
);
var integer = Rules.CharIsDigit()
.Many(true)
.JoinText()
.MapToInteger();
81. Is it a good idea?
public static Rule<Token, Token> Not<Token, TResult>(this Rule<Token, TResult> rule)
=> (source) => source.Match(
empty => new FailResult<Token, Token>("Unexpected EOF"),
current => rule(current).Match(
fail => new SuccessResult<Token, Token>(current.Current, current.Next()),
success => (IResult<Token, Token>)new FailResult<Token, Token>("Unexpected match")
)
);
public static Rule<Token, TOut> MapTo<Token, TIn, TOut>(this Rule<Token, TIn> rule, Func<TIn, TOut> convert)
=> (source) => rule(source).Match(
fail => (IResult<Token, TOut>)new FailResult<Token, TOut>(fail.Message),
success => new SuccessResult<Token, TOut>(convert(success.Value), success.Next)
);
public static Rule<char, string> JoinText(this Rule<char, char[]> rule)
=> MapTo(rule, (x) => new string(x));
public static Rule<char, int> MapToInteger(this Rule<char, string> rule)
=> MapTo(rule, (x) => int.Parse(x));
82. Limitations
“At Zombocom, the only limit…
is yourself.”
1. Makes a LOT of short-lived
objects (ISources, IResults).
2. As written currently, you will end
up with the entire thing in
memory.
3. Visual Studio’s Intellisense
struggles with nested lambdas.
4. Frequently requires casts to solve
type inference problems.
5. It’s not very C#.
84. Iterations
Iteration 1.0: Procedural
Iteration 2.0: Making Compositional
with OOP
Iteration 2.1: Immutability
Iteration 2.2: Discriminated Unions and
Pattern Matching
Iteration 3.0: Functions as First Class
Citizens