State machines are an important tool in computer programming, and Ragel is a wonderful tool for creating them. Come learn how to use Ragel to compose simple state machines into much more complicated versions useful for parsing and processing all manner of input. We'll progress simple regex-like machines to full-blown context-sensitive scanners capable of ripping-fast processing of protocols and language grammars.
https://www.youtube.com/watch?v=Tr83XxNRg3k
Github: https://github.com/ijcd
Twitter: @ijcd
San Francisco, California
SPEAKER NOTES:
-------------
Most programmers should be familiar with the standard regexp form.
Ragel excels at ripping-fast parsing and processing of textual data.
These can be used to wire machines together. Composition. Computer science.
They are, more or less. However, Ragel has a few more tricks up it's sleeve. We're going to compose these simple machines. And execute arbitrary actions at any point inside them. That is when things get really cool.
From a high-level, it helps you build regular expressions, but with an important difference. With Ragel, you have the ability to stop at any point in the regexp parse and execute code in the host language. This is incredibly powerful. It means that rather than having a large program with lots of regexps, loops, and conditionals, we can have one EBNF-ish looking definition that, instead, calls out to our code when we need it to. You can do some really cool tricks with this.
The machine definition statement associates an FSM expression with a name. Machine expressions assigned to names can later be referenced in other expressions. A definition statement on its own does not cause any states to be generated. It is simply a description of a machine to be used later. States are generated only when a definition is instantiated, which happens when a definition is referenced in an instantiated expression.
This is the part of Ragel that I found fascinating when I first grokked it. This compositional technique is what gives Ragel it's extreme simplicity and combinational power. I can't stress this point enough.
The operation first creates a new start state. Epsilon transitions are drawn from the new start state to the start states of both input machines. Nondeterminism. If there are strings, or prefixes of strings that are matched by both machines then the new machine will follow both parts of the alternation at once. The union operation is shown below.
On the surface, Ragel scanners are similar to those defined by Lex.
Though there is a key distinguishing feature: patterns may be arbitrary Ragel expressions and can therefore contain embedded code.
With a Ragel-based scanner the user need not wait until the end of a pattern before user code can be executed.
Scanners can be used to process sub-languages, as well as for tokenizing programming languages.
You can use fcall and fret to jump around in the parser, like function calls.
Se puede encontrar en:
https://github.com/jksrecko/libaria/blob/master/examples/directMotionExample.cpp
Agradesco a la persona que compartio este codigo ya que muestra una idea general de lo que se puede hacer con el robot AmigoBot
jksrecko
In this you learn about Control Statements
1. Selection Statements
i. If
ii. If-else
iii. Nested-if
iv. If-Elseif ladder
2. Looping Statements
i. while loop
ii. do-while loop
iii. For loop
3. Jumping Statements
i. break
ii. continue
iii return
The document discusses various control structures in C++ like conditional statements (if-else, switch), loops (while, for, do-while), and jump statements (break, continue, goto). It provides examples to explain if-else, switch, while, for, do-while loops. Nested loops and break/continue statements are also covered. The last section briefly explains unconditional jump with goto statement.
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...Mark Simon
Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without
the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make
programming easier, more flexible, and more fun. Swift’s clean slate, backed by the mature and much-loved Cocoa
and Cocoa Touch frameworks, is an opportunity to reimagine how software development works.
(download for flawless quality) A brief introduction to unison, the exciting and innovative new functional programming language.
Wholly based on a talk by Paul Chiusano.
The document discusses switch case statements in programming. It provides details on the basic format and usage of switch case statements, including that they allow a variable to be tested for equality against multiple values through different cases. The document also notes some key rules for switch cases, such as requiring a break statement at the end of each case and that case values must be integer or character constants. It provides examples of switch case statements and discusses how they can provide a cleaner alternative to long if-else statements.
Cordova training : Day 3 - Introduction to JavascriptBinu Paul
This document provides an introduction to JavaScript, including:
- JavaScript is a lightweight, interpreted programming language commonly used in web pages.
- Advantages of JavaScript include less server interaction, immediate feedback, and richer interfaces.
- Disadvantages include inability to read/write files for security and lack of multithreading.
- JavaScript syntax can be included in HTML using <script> tags and ignores spaces/newlines.
- Basic data types are strings, numbers, and Booleans, and variables are declared with var.
- Common operators include arithmetic, comparison, logical, and assignment operators.
- Control structures include if/else statements, switch statements, for/while loops.
- Functions are reusable blocks
Se puede encontrar en:
https://github.com/jksrecko/libaria/blob/master/examples/directMotionExample.cpp
Agradesco a la persona que compartio este codigo ya que muestra una idea general de lo que se puede hacer con el robot AmigoBot
jksrecko
In this you learn about Control Statements
1. Selection Statements
i. If
ii. If-else
iii. Nested-if
iv. If-Elseif ladder
2. Looping Statements
i. while loop
ii. do-while loop
iii. For loop
3. Jumping Statements
i. break
ii. continue
iii return
The document discusses various control structures in C++ like conditional statements (if-else, switch), loops (while, for, do-while), and jump statements (break, continue, goto). It provides examples to explain if-else, switch, while, for, do-while loops. Nested loops and break/continue statements are also covered. The last section briefly explains unconditional jump with goto statement.
The Swift Programming Language - Xcode6 for iOS App Development - AgileInfowa...Mark Simon
Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without
the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make
programming easier, more flexible, and more fun. Swift’s clean slate, backed by the mature and much-loved Cocoa
and Cocoa Touch frameworks, is an opportunity to reimagine how software development works.
(download for flawless quality) A brief introduction to unison, the exciting and innovative new functional programming language.
Wholly based on a talk by Paul Chiusano.
The document discusses switch case statements in programming. It provides details on the basic format and usage of switch case statements, including that they allow a variable to be tested for equality against multiple values through different cases. The document also notes some key rules for switch cases, such as requiring a break statement at the end of each case and that case values must be integer or character constants. It provides examples of switch case statements and discusses how they can provide a cleaner alternative to long if-else statements.
Cordova training : Day 3 - Introduction to JavascriptBinu Paul
This document provides an introduction to JavaScript, including:
- JavaScript is a lightweight, interpreted programming language commonly used in web pages.
- Advantages of JavaScript include less server interaction, immediate feedback, and richer interfaces.
- Disadvantages include inability to read/write files for security and lack of multithreading.
- JavaScript syntax can be included in HTML using <script> tags and ignores spaces/newlines.
- Basic data types are strings, numbers, and Booleans, and variables are declared with var.
- Common operators include arithmetic, comparison, logical, and assignment operators.
- Control structures include if/else statements, switch statements, for/while loops.
- Functions are reusable blocks
Regular Expression to Non-Deterministic Finite Automata ConverterIRJET Journal
This document describes a process for converting regular expressions to non-deterministic finite automata (NFA). It discusses Thompson's algorithm, which divides regular expressions into smaller chunks and transforms them into NFAs that are then combined. The algorithm has 5 simple rules and works by treating each symbol as an NFA, combining NFAs for concatenation, adding epsilon transitions for union and Kleene star. The proposed system would accept a regular expression, define a transition table, check the expression against conditions defined by the algorithm, and display the resulting NFA transition table. Future work could include optimizing the NFA size and error handling to improve reliability.
Regular expression denial of service (ReDoS) attacks exploit the fact that regex engines can enter exponential backtracking situations on certain inputs. This can cause programs using regex to hang indefinitely. The Cloudflare outage in July 2019 was caused by a ReDoS vulnerability in one of their WAF rules containing the pattern ".*.*=.*", which led to catastrophic backtracking when the "=" was missing. Mitigations include using lazy/possessive quantifiers to reduce backtracking, or rewriting patterns to avoid backtracking engines and instead use deterministic finite automata.
The document discusses the basic structure of a C program, which includes documentation, link, definition, global declarations, main functions, and subprograms sections. It also summarizes the key components of a C program like data types, variables, expressions, statements, operators, library functions, input/output functions, and control flow statements like if/else, loops. The main function contains the declaration and execution parts, while user-defined functions are defined in the subprogram section. Common input functions like scanf and output functions like printf are also summarized.
The document discusses Duff's device, a technique that exploits the fall-through behavior of switch statements in C to optimize a copying loop. It describes how Duff's device works by using a switch statement to determine how many times a do-while loop needs to execute based on a count value, allowing the loop to be executed fewer times with fewer goto statements than a standard do-while implementation. While an interesting technique, the document notes that Duff's device is not widely used due to its exploitation of undefined C behavior.
“Loop in C – Properties, and Applications”. We will cover Introduction, Details, Advantages, History, Types of Loops, Flowcharts, Practical Use, Outputs, and Conclusion. What is a loop? We are all familiar with the idea of listening to songs on loops. But, we are obviously not here to speak on that.
What is a loop in C? Looping Statements in C execute the sequence of statements many times until the stated condition becomes false. It has mainly 2 parts – a body of a loop and a control statement. The main purpose is to repeat the same code a number of times.
The document discusses various control structures and functions used in Arduino programming including decision making structures like if, else if, else statements and switch case statements. It also covers different types of loops like while, do-while and for loops that allow repeating blocks of code. Functions are described as reusable blocks of code that perform tasks and help organize a program. Strings can be implemented as character arrays or using the String class, and various string functions are provided to manipulate and work with strings.
The document discusses key concepts in C# programming including data types, operators, control flow statements, methods, classes, and arrays. It provides examples and descriptions of common language elements like namespaces, classes, methods, variables, operators, loops, and conditional statements. Type conversion methods and how to accept user input and initialize arrays are also summarized.
The document discusses key concepts in C# programming including data types, operators, control flow statements, methods, classes, arrays, and more. It provides definitions and examples of common terms like namespaces, classes, methods, operators, loops, and exceptions. Type conversion methods in C# are also summarized in a table listing common conversion functions.
This document provides an overview of the Java programming language. It discusses Java's history and why it was created. It also outlines some of Java's key fundamentals like variables, data types, operators, and control statements. Additionally, it covers object-oriented programming concepts in Java like classes, objects, inheritance and encapsulation. The document is intended to help readers get started with learning Java.
Slides: http://pa4373.github.io/jstutorials_corepart/
GitHub Repo: https://github.com/pa4373/jstutorials_corepart
This is the first part of JavaScript programming tutorials. This tutorial introduces the brief history of JavaScript, the relationship of the specification and a variety of implementations, and then the basic syntax and the concepts are introduced, that can be generally applied to programming interactions with different runtimes.
This document discusses loops in C++ programming. It defines while, for, and do-while loops and how each one works. It also describes loop control statements like break, continue, and goto that change the normal execution of loops. Finally, it provides an example of an infinite loop in C++ using a for loop without a conditional expression to repeat indefinitely.
Functional Programming for OO Programmers (part 1)Calvin Cheng
The Why and Benefits of Functional Programming paradigm. Part 2 with source code can be found here: http://www.slideshare.net/calvinchengx/functional-programming-for-oo-programmers-part-2
Related source code https://github.com/calvinchengx/learnhaskell
Chapter 2: Introduction to Bash Scriptingazzamhadeel89
This document provides an introduction to Bash scripting. It outlines key Bash concepts like variables, conditionals, looping, functions, and pattern matching. The document then dives into each concept in more detail, providing examples for how to use output, variables, conditionals like if/else, looping with while and for, defining functions, and returning values. It explains how to pass arguments to functions and access parameters. The goal is to cover the essential elements of Bash to write basic scripts.
States, state graphs and transition testinggeethawilliam
The document discusses software testing techniques using finite state machines and state graphs. It provides details on:
1) Defining states, inputs, transitions, and outputs in a state graph to model software behavior.
2) Implementing state graphs using state tables to encode inputs, specify transitions between states, and define outputs.
3) Identifying good properties of state graphs like having a specified transition for each state/input pair and ways to return to each state, as well as bad properties like equivalent states.
States, state graphs and transition testingABHISHEK KUMAR
The document discusses finite state machines and state graphs. Some key points:
- State graphs can model software behavior using states, inputs that cause transitions between states, and outputs.
- States represent conditions or attributes of what is being modeled. Transitions between states are caused by inputs.
- State graphs can be represented as state tables for clarity, with rows for each state and columns for each input.
- Finite state machines are useful for software testing as they provide models of software structure and behavior to design tests against.
This document discusses cursors in PL/SQL. It begins by defining cursors and their types, including implicit and explicit cursors. It then covers processing explicit cursors using declare, open, fetch, and close statements. The document also discusses cursor attributes, parameterized cursors, advanced cursor features like SELECT FOR UPDATE, and cursor variables including declaring REF cursor types and variables. The overall purpose is to explain how to work with different types of cursors in PL/SQL to retrieve and manipulate result sets.
This document provides an overview of a talk on advanced Zemax Programming Language (ZPL) macro programming. It introduces the speakers and describes the structure of the talk, which will cover what ZPL is, examples of using ZPL for specific tasks like calculating ray angles of incidence across a pupil, and tips for writing macros. The document outlines several example macros that will be discussed in detail during the talk, including automating repetitive tasks and creating custom operands. It encourages participants to provide feedback and suggestions for additional topics.
The document discusses the different phases of a compiler:
1. Lexical analysis breaks source code into tokens by removing whitespace and comments.
2. Syntax analysis checks the grammar and generates a parse tree by applying production rules to the token stream.
3. Regular expressions and finite automata are used to recognize patterns and validate tokens during lexical analysis.
The document provides an overview of the C programming language, including its history, uses, basic syntax, data types, variables, operators, decision making structures, loops, functions, and other common features. It begins with an introduction to C and discusses setting up the development environment. It then covers the basic structure of C programs and many fundamental aspects of the language like tokens, comments, identifiers, keywords and basic syntax rules.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
More Related Content
Similar to RubyConf 2015 - Stately State Machines with Ragel - Ian Duggan
Regular Expression to Non-Deterministic Finite Automata ConverterIRJET Journal
This document describes a process for converting regular expressions to non-deterministic finite automata (NFA). It discusses Thompson's algorithm, which divides regular expressions into smaller chunks and transforms them into NFAs that are then combined. The algorithm has 5 simple rules and works by treating each symbol as an NFA, combining NFAs for concatenation, adding epsilon transitions for union and Kleene star. The proposed system would accept a regular expression, define a transition table, check the expression against conditions defined by the algorithm, and display the resulting NFA transition table. Future work could include optimizing the NFA size and error handling to improve reliability.
Regular expression denial of service (ReDoS) attacks exploit the fact that regex engines can enter exponential backtracking situations on certain inputs. This can cause programs using regex to hang indefinitely. The Cloudflare outage in July 2019 was caused by a ReDoS vulnerability in one of their WAF rules containing the pattern ".*.*=.*", which led to catastrophic backtracking when the "=" was missing. Mitigations include using lazy/possessive quantifiers to reduce backtracking, or rewriting patterns to avoid backtracking engines and instead use deterministic finite automata.
The document discusses the basic structure of a C program, which includes documentation, link, definition, global declarations, main functions, and subprograms sections. It also summarizes the key components of a C program like data types, variables, expressions, statements, operators, library functions, input/output functions, and control flow statements like if/else, loops. The main function contains the declaration and execution parts, while user-defined functions are defined in the subprogram section. Common input functions like scanf and output functions like printf are also summarized.
The document discusses Duff's device, a technique that exploits the fall-through behavior of switch statements in C to optimize a copying loop. It describes how Duff's device works by using a switch statement to determine how many times a do-while loop needs to execute based on a count value, allowing the loop to be executed fewer times with fewer goto statements than a standard do-while implementation. While an interesting technique, the document notes that Duff's device is not widely used due to its exploitation of undefined C behavior.
“Loop in C – Properties, and Applications”. We will cover Introduction, Details, Advantages, History, Types of Loops, Flowcharts, Practical Use, Outputs, and Conclusion. What is a loop? We are all familiar with the idea of listening to songs on loops. But, we are obviously not here to speak on that.
What is a loop in C? Looping Statements in C execute the sequence of statements many times until the stated condition becomes false. It has mainly 2 parts – a body of a loop and a control statement. The main purpose is to repeat the same code a number of times.
The document discusses various control structures and functions used in Arduino programming including decision making structures like if, else if, else statements and switch case statements. It also covers different types of loops like while, do-while and for loops that allow repeating blocks of code. Functions are described as reusable blocks of code that perform tasks and help organize a program. Strings can be implemented as character arrays or using the String class, and various string functions are provided to manipulate and work with strings.
The document discusses key concepts in C# programming including data types, operators, control flow statements, methods, classes, and arrays. It provides examples and descriptions of common language elements like namespaces, classes, methods, variables, operators, loops, and conditional statements. Type conversion methods and how to accept user input and initialize arrays are also summarized.
The document discusses key concepts in C# programming including data types, operators, control flow statements, methods, classes, arrays, and more. It provides definitions and examples of common terms like namespaces, classes, methods, operators, loops, and exceptions. Type conversion methods in C# are also summarized in a table listing common conversion functions.
This document provides an overview of the Java programming language. It discusses Java's history and why it was created. It also outlines some of Java's key fundamentals like variables, data types, operators, and control statements. Additionally, it covers object-oriented programming concepts in Java like classes, objects, inheritance and encapsulation. The document is intended to help readers get started with learning Java.
Slides: http://pa4373.github.io/jstutorials_corepart/
GitHub Repo: https://github.com/pa4373/jstutorials_corepart
This is the first part of JavaScript programming tutorials. This tutorial introduces the brief history of JavaScript, the relationship of the specification and a variety of implementations, and then the basic syntax and the concepts are introduced, that can be generally applied to programming interactions with different runtimes.
This document discusses loops in C++ programming. It defines while, for, and do-while loops and how each one works. It also describes loop control statements like break, continue, and goto that change the normal execution of loops. Finally, it provides an example of an infinite loop in C++ using a for loop without a conditional expression to repeat indefinitely.
Functional Programming for OO Programmers (part 1)Calvin Cheng
The Why and Benefits of Functional Programming paradigm. Part 2 with source code can be found here: http://www.slideshare.net/calvinchengx/functional-programming-for-oo-programmers-part-2
Related source code https://github.com/calvinchengx/learnhaskell
Chapter 2: Introduction to Bash Scriptingazzamhadeel89
This document provides an introduction to Bash scripting. It outlines key Bash concepts like variables, conditionals, looping, functions, and pattern matching. The document then dives into each concept in more detail, providing examples for how to use output, variables, conditionals like if/else, looping with while and for, defining functions, and returning values. It explains how to pass arguments to functions and access parameters. The goal is to cover the essential elements of Bash to write basic scripts.
States, state graphs and transition testinggeethawilliam
The document discusses software testing techniques using finite state machines and state graphs. It provides details on:
1) Defining states, inputs, transitions, and outputs in a state graph to model software behavior.
2) Implementing state graphs using state tables to encode inputs, specify transitions between states, and define outputs.
3) Identifying good properties of state graphs like having a specified transition for each state/input pair and ways to return to each state, as well as bad properties like equivalent states.
States, state graphs and transition testingABHISHEK KUMAR
The document discusses finite state machines and state graphs. Some key points:
- State graphs can model software behavior using states, inputs that cause transitions between states, and outputs.
- States represent conditions or attributes of what is being modeled. Transitions between states are caused by inputs.
- State graphs can be represented as state tables for clarity, with rows for each state and columns for each input.
- Finite state machines are useful for software testing as they provide models of software structure and behavior to design tests against.
This document discusses cursors in PL/SQL. It begins by defining cursors and their types, including implicit and explicit cursors. It then covers processing explicit cursors using declare, open, fetch, and close statements. The document also discusses cursor attributes, parameterized cursors, advanced cursor features like SELECT FOR UPDATE, and cursor variables including declaring REF cursor types and variables. The overall purpose is to explain how to work with different types of cursors in PL/SQL to retrieve and manipulate result sets.
This document provides an overview of a talk on advanced Zemax Programming Language (ZPL) macro programming. It introduces the speakers and describes the structure of the talk, which will cover what ZPL is, examples of using ZPL for specific tasks like calculating ray angles of incidence across a pupil, and tips for writing macros. The document outlines several example macros that will be discussed in detail during the talk, including automating repetitive tasks and creating custom operands. It encourages participants to provide feedback and suggestions for additional topics.
The document discusses the different phases of a compiler:
1. Lexical analysis breaks source code into tokens by removing whitespace and comments.
2. Syntax analysis checks the grammar and generates a parse tree by applying production rules to the token stream.
3. Regular expressions and finite automata are used to recognize patterns and validate tokens during lexical analysis.
The document provides an overview of the C programming language, including its history, uses, basic syntax, data types, variables, operators, decision making structures, loops, functions, and other common features. It begins with an introduction to C and discusses setting up the development environment. It then covers the basic structure of C programs and many fundamental aspects of the language like tokens, comments, identifiers, keywords and basic syntax rules.
Similar to RubyConf 2015 - Stately State Machines with Ragel - Ian Duggan (20)
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfUndress Baby
The quest for the best AI face swap solution is marked by an amalgamation of technological prowess and artistic finesse, where cutting-edge algorithms seamlessly replace faces in images or videos with striking realism. Leveraging advanced deep learning techniques, the best AI face swap tools meticulously analyze facial features, lighting conditions, and expressions to execute flawless transformations, ensuring natural-looking results that blur the line between reality and illusion, captivating users with their ingenuity and sophistication.
Web:- https://undressbaby.com/
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
2. GOALS FOR THIS TALK
1. Convince you that Ragel is worth trying.
2. Give you some intui?on about how it works.
3. Show you how to setup a basic parser.
13. SOFTWARE! FTW!
I'm a soKware dude. I code things. I code the internets and
the googles. I'm also a recovering technology entrepreneur.
I've been in and out of startup ins?tu?ons my en?re life.
22. BUT REGULAR EXPRESSIONS ARE EASY!
Regular expressions consist of constants and operator
symbols that denote sets of strings and opera?ons over
these sets, respec?vely. (from Wikipedia)
23. RUBY HAS GREAT TOOLS FOR REGULAR
EXPRESSIONS
You can get by with them. You can especially get by with
them in Ruby which draws its heritage from Perl, Sed, and
Awk which made wonderful use of regexps.
25. SOMETIMES YOU WANT MORE CONTROL
I posit that this might be some sort of automaton.
26. FINITE AUTOMATA
• Have states and transi?ons.
• Change state based on sequence of inputs.
• DFA can be in only one state at a ?me.
• NFA can be in more than one state at a ?me.
27. EQUIVALENCE OF REGULAR EXPRESSIONS,
NFAS, AND DFAS
It is possible to convert freely between
regular expressions, determinis9c finite
automata, and nondeterminis9c finite
automata. Given one, we can convert it to
any of the other forms.
h"p://faculty.ycp.edu/~dhovemey/fall2008/cs340/notes/lecture3.html
28. THESE ARE ALL STATE MACHINES
State machines are an important tool in computer
programming, and Ragel is a wonderful tool for crea?ng
them.
32. THERE ARE EXAMPLES EVERYWHERE
• watch with ?mer
• vending machine
• traffic light
• bar code scanner
• gas pumps
• number classifica?on
33. THE CAT'S MEOW?
State machines are great for many reasons. They are simple
to understand, and there has been a great deal of research
around finite automata and state machines. With the right
approach they can also produce code that is faster, easier to
maintain, and more correct and thus, more secure.
34. STILL NOT CONVINCED?
Rather than me trying to convince you that they're useful,
let's just talk about them for a bit and see where we end up.
42. WHAT’S THE BIG DEAL?
They just look like regular expressions.
43. WHAT IS RAGEL EXACTLY?
Ragel is a finite-state machine compiler with
output support for C, C++, C#, Objec9ve-C, D,
Java, OCaml, Go, and Ruby source code. It
supports the genera9on of table or control flow
driven state machines from regular expressions
and/or state charts and can also build lexical
analysers via the longest-match method. Ragel
specifically targets text parsing and input
valida9on.
h"ps://en.wikipedia.org/wiki/Ragel
44. STATE MACHINE GENERATION
Ragel supports the genera9on of table or control flow
driven state machines from regular expressions and/or
state charts and can also build lexical analysers via the
longest-match method. A unique feature of Ragel is that
user ac9ons can be associated with arbitrary state
machine transi9ons using operators that are integrated
into the regular expressions. Ragel also supports
visualiza9on of the generated machine via graphviz.
h"ps://en.wikipedia.org/wiki/Ragel
45. HOW DO YOU PRONOUNCE IT?
• RAY-gull?
• RAY-jul?
• RAH-gull?
• RAH-jul?
51. GENERAL STRUCTURE OF A RAGEL FILE
• Mostly in the host language
• has a .rl extension (simple.rl)
• %% is used for inline statements
• %%{ is used for mul?line statements }%%
52. NAMING A MACHINE
With named machines, you can spread a
machine's statements across several files or
include common sec?ons.
54. MACHINE INSTANTIATION
This causes the actual genera?on of the referenced set of states.
Each instan?a?on generates a dis?nct set of states.
55. FILE INCLUSION AND IMPORT
You can include and import defini?ons from other files.
These can help you keep things organized. See the manual
for the specific seman?cs of each.
71. BUILDING BLOCKS
We have simple machines now.
Like levers, wedges, wheels, and pulleys.
But let's not stop here.
From simple machines we can make complex machines.
75. COMPOSITION
Ragel's DSL allows you to take these simple machines, and
through some basic operators, combine those into bigger
machines, and then combine those into BIGGER machines.
89. ONE OR MORE REPETITION
Produces the concatena?on of the machine with the kleene
star of itself. The result will match one or more repe??ons of
the machine.
Equivalent to:
96. STATE MACHINE MINIMIZATION
• Reduces the number of states through op?miza?on
• Merges equivalent states
• On by default (can be disabled with -n)
97. USER ACTIONS
Composi?on is definitely cool and useful. But on top of that,
Ragel gives you embedded ac?ons. This is where you take all
the composi?on and really make it sing, on key.
104. EMBEDDING OPERATORS CAN GET FANCY
See the manual for more informa?on on these:
• To-State Ac?ons
• From-State Ac?ons
• EOF Ac?ons
• Global Error Ac?ons (for error recovery)
• Local Error Ac?ons (for error recovery)
105. NONDETERMINISM
One of the problems you will run into is when the trailing
match of one machine is the same as the leading match of
the next machine. In these cases, the state will be stuck in
the first machine and never transi?on to the next machine.
106. NONDETERMINISM EXAMPLE
The n in ws will prevent the final n from matching.
The solu?on here is simple: exclude the newline character
from the ws expression.
107. AMBIGUITY PROBLEMS
Here's an incorrect way to parse C language comments:
The any will prevent the trailing */ from ever matching.
108. THIS WORKS BUT IT’S UGLY
We have to carefully exclude things to get it to match.
109. THIS IS GETTING COMPLICATED!
But there’s a solu?on.
Ragel lets you embed priori?es into transi?ons to deal with
ambiguity.
112. GUARDED OPERATIONS
Thinking in priori?es is hard.
Fortunately, Ragel provides some beler mechanisms for us
to use.
These are called “guarded concatena?ons”
113. FINISH-GUARDED CONCATENATION
A higher priority is then embedded into the transi?ons of the
second machine that enter into a final state.
This is much simpler to visualize and reason about.
119. PROTOCOL PARSING
Ragel is well suited for protocol parsing.
Mapping an RFC onto a Ragel specifica?on is prely straight-
forward.
Puma has a good example of this (heritage is the original
mongrel parser by Zed Shaw)
h"ps://github.com/puma/puma/blob/master/ext/puma_h"p11/h"p11_parser_common.rl
120. STATE CHARTS
Ragel allows you to specify states and transi?ons directly if
you desire extreme customiza?on.
This is like programming in the "assembly" of Ragel.
There are a few new operators for this.
123. PARSING RECURSIVE STRUCTURES
The general trick is to store some context about where
you are in your recursive structure, say in a stack called
@nesMngs, and push/pop to it as appropriate. When it
comes ?me to call fret, you can examine your @nesMngs
and steer the parser as deemed appropriate.
124. IMPLEMENTING LOOKAHEAD
This is possible. The trick here is to match deeper than you
need, then use fhold to walk the parser back a few
characters.
125. RAGEL INTERNALS
Ragel uses several variables for state. You can twiddle
them in ac?ons.
Those are the major ones. See the manual for more details.
126. RAGEL OPERATION (ROUGHLY)
1. Starts in state 0
2. Feed it data, upda?ng p and pe as appropriate
3. Run the %%exec loop
4. Characters move it through a state
5. It consumes p -> pe from data
6. If cs is >= first_final_state (final states are
last) then you have “admiled” the string
127. RAGEL OPERATION (SCANNERS)
Scanners are a bit more involved, but not that much more.
1. Use a stack to track states
2. Use ts -> te to track where they are in a match
3. Use the stack to backtrack when necessary
4. Keep matching repeatedly un?l we are done
5. Longest match wins
6. It's useful to create helper methods (emit,
current_buffer, current_match(start, end))
128. RAGEL STRING EXTRACTION
To pull out the data you care about, while you are parsing, you will do
something like this:
130. CODE STYLES
Ragel uses your .rl code to compute the set of states and transi?ons.
From that, it can generate code in a number of different styles.
131. CODE STYLES PERFORMANCE
Each of these has different visual organiza?on and
performance characteris?cs. In languages like C, this can boil
down to heavily-op?mized GOTO statements in a single
while loop. It's fast and cpu-cache friendly.
132. MULTI-LANGUAGE
It's possible to have a single Ragel defini?on that uses import
seman?cs to allow implemen?ng the ac?ons in different
languages using the same parent Ragel file. See the hlp11
parser in puma for details (C and Java)
h"ps://github.com/puma/puma/tree/master/ext/puma_h"p11
133. RAGEL IN C
It's also possible to prototype in Ruby, then convert it to a C
module for super-speed. Ragel supports several output
formats so you can do this port rather easily.
Again, see mongrel or puma for ideas.
134. RAGEL DIRECTIVES - INIT
Ini?alizes the data buffer and sets the current state:
135. RAGEL DIRECTIVES - DATA
Writes out defini?ons of the state and transi?on data:
136. RAGEL DIRECTIVES - EXEC
Writes out the code that processes the data buffer
using the state and transi?on data:
144. RAGEL PLAYGROUND
I created a tool in Volt to do some basic visualiza?on.
It's definitely a work in progress, but feel free to try it out.
h"ps://github.com/ijcd/ragel_playground