An introduction to Perl and what you can learn in an introductory course. An entire "eliza"-like program is written and the perl features explained in about twenty minutes.
Fog City Ruby - Triple Equals Black Magic with speaker notesBrandon Weaver
This is the same talk, except with all my speaker notes. I use speaker notes post-talk as a way to explain and "tutorialize" a presentation, so enjoy!
The presentation I did at Fog City Ruby over how === works and some of the things you can do with it.
Want more? Try these articles where I explain some of it:
* https://medium.com/@baweaver/for-want-of-pattern-matching-in-ruby-the-creation-of-qo-c3b267109b25
* https://medium.com/@baweaver/for-want-of-pattern-matching-in-ruby-the-creation-of-qo-c3b267109b25
The document discusses CoffeeScript, a programming language that compiles to JavaScript. It was designed to have cleaner syntax than JavaScript and be easier to read and write. CoffeeScript code compiles directly to equivalent JavaScript code. Using CoffeeScript can help developers write less code that is more readable and maintainable while still being able to use existing JavaScript libraries. The document provides examples of CoffeeScript code and the equivalent JavaScript output. It also discusses how to use CoffeeScript with Ruby on Rails projects by adding the Barista gem.
This document provides examples of how to perform common tasks in Ruby and Ruby on Rails using less code compared to other languages like C#. It begins with an overview of Ruby's simplicity and complexity. Several examples are given that show how to create hashes, print output, build binary trees, define classes and modules, call methods, perform calculations, sort and select data, define instance behaviors, and include modules. The document concludes by providing examples of generating a basic Twitter clone app in Rails and scaling it up.
The slides for introducing Python to beginner. This is a complimentary class made in Wekanta's Soft Launch in Universities within Malaysia.
Slides Overview:
• Python Background
• Syntax
• Variables
• Data Structure
• Comparison
• Control Flow
• Function
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports functional, aspect-oriented, and design-by-contract programming paradigms. It is well-suited for practices like extreme programming.
- Core concepts include classes, modules, blocks/iterators, exceptions, regular expressions and strings. Common data structures include arrays, hashes, ranges and more.
- Examples demonstrate basic syntax like variables, loops, conditions, classes and modules. Ruby emphasizes flexibility, dynamism and "
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports functional, aspect-oriented, and design-by-contract programming paradigms. It is well-suited for practices like extreme programming.
- Core concepts include classes, modules, blocks/iterators, exceptions, regular expressions and strings. Common data structures include arrays, hashes, ranges and more.
- Examples demonstrate basic syntax like variables, loops, conditions, classes and modules. Ruby emphasizes flexibility, dynamism and "
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports functional, aspect-oriented, and design-by-contract programming paradigms. It is well-suited for practices like extreme programming.
- Core concepts include classes, modules, blocks/iterators, exceptions, regular expressions and strings. Common data structures include arrays, hashes, ranges and more.
- Examples demonstrate basic syntax like variables, loops, conditions, classes and modules. Ruby emphasizes flexibility, dynamism and "
This document provides an overview of the Ruby programming language for Perl programmers. Ruby is an interpreted, object-oriented scripting language that is very similar to Perl but also introduces significant differences. Both languages are suitable for tasks like text processing and system administration scripts. Ruby places a stronger emphasis on object-oriented principles and is more dynamic than Perl.
Fog City Ruby - Triple Equals Black Magic with speaker notesBrandon Weaver
This is the same talk, except with all my speaker notes. I use speaker notes post-talk as a way to explain and "tutorialize" a presentation, so enjoy!
The presentation I did at Fog City Ruby over how === works and some of the things you can do with it.
Want more? Try these articles where I explain some of it:
* https://medium.com/@baweaver/for-want-of-pattern-matching-in-ruby-the-creation-of-qo-c3b267109b25
* https://medium.com/@baweaver/for-want-of-pattern-matching-in-ruby-the-creation-of-qo-c3b267109b25
The document discusses CoffeeScript, a programming language that compiles to JavaScript. It was designed to have cleaner syntax than JavaScript and be easier to read and write. CoffeeScript code compiles directly to equivalent JavaScript code. Using CoffeeScript can help developers write less code that is more readable and maintainable while still being able to use existing JavaScript libraries. The document provides examples of CoffeeScript code and the equivalent JavaScript output. It also discusses how to use CoffeeScript with Ruby on Rails projects by adding the Barista gem.
This document provides examples of how to perform common tasks in Ruby and Ruby on Rails using less code compared to other languages like C#. It begins with an overview of Ruby's simplicity and complexity. Several examples are given that show how to create hashes, print output, build binary trees, define classes and modules, call methods, perform calculations, sort and select data, define instance behaviors, and include modules. The document concludes by providing examples of generating a basic Twitter clone app in Rails and scaling it up.
The slides for introducing Python to beginner. This is a complimentary class made in Wekanta's Soft Launch in Universities within Malaysia.
Slides Overview:
• Python Background
• Syntax
• Variables
• Data Structure
• Comparison
• Control Flow
• Function
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports functional, aspect-oriented, and design-by-contract programming paradigms. It is well-suited for practices like extreme programming.
- Core concepts include classes, modules, blocks/iterators, exceptions, regular expressions and strings. Common data structures include arrays, hashes, ranges and more.
- Examples demonstrate basic syntax like variables, loops, conditions, classes and modules. Ruby emphasizes flexibility, dynamism and "
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports functional, aspect-oriented, and design-by-contract programming paradigms. It is well-suited for practices like extreme programming.
- Core concepts include classes, modules, blocks/iterators, exceptions, regular expressions and strings. Common data structures include arrays, hashes, ranges and more.
- Examples demonstrate basic syntax like variables, loops, conditions, classes and modules. Ruby emphasizes flexibility, dynamism and "
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports functional, aspect-oriented, and design-by-contract programming paradigms. It is well-suited for practices like extreme programming.
- Core concepts include classes, modules, blocks/iterators, exceptions, regular expressions and strings. Common data structures include arrays, hashes, ranges and more.
- Examples demonstrate basic syntax like variables, loops, conditions, classes and modules. Ruby emphasizes flexibility, dynamism and "
This document provides an overview of the Ruby programming language for Perl programmers. Ruby is an interpreted, object-oriented scripting language that is very similar to Perl but also introduces significant differences. Both languages are suitable for tasks like text processing and system administration scripts. Ruby places a stronger emphasis on object-oriented principles and is more dynamic than Perl.
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports features like classes, modules, blocks/iterators, exceptions, regular expressions and threads. Everything in Ruby is an object.
- Compared to Perl, Ruby is more object-oriented, dynamic, and has built-in support for threads. Syntax also differs in some key ways.
- The document provides examples of basic Ruby syntax like variables, loops, conditions, classes and modules to illustrate how the language works.
This document provides an overview of the Ruby programming language for Perl programmers. Ruby is an interpreted, object-oriented scripting language that is very similar to Perl in many ways, such as its syntax for regular expressions and control structures like loops and conditionals. However, Ruby differs from Perl in that it was designed from the start to be object-oriented and highly dynamic. The document discusses Ruby's core concepts like classes, modules, blocks and iterators in detail and provides many code examples to illustrate Ruby's syntax and features.
This document provides an introduction and overview of the Ruby programming language. It discusses Ruby's history and creator Yukihiro Matsumoto. It demonstrates basic Ruby syntax like integers, floats, strings, variables, methods, and flow control. It also covers Ruby classes, objects, and the interactive Ruby shell IRB. The document then introduces common Ruby libraries and frameworks like Sinatra for web development and Nokogiri for parsing HTML/XML. It includes code examples to demonstrate basic usage.
These are slides from a lecture on Red Flags in Programming that took place at an Israeli Open Source Developers meeting.
Red flags in programming are signs that you likely made a mistake with your application design or code.
Noticing and avoiding these mistakes help us write better code, at any language.
The subject related to mostly dynamic (higher level) languages, even though the sample code is in Perl.
Ruby on Rails is a popular web application framework written in Ruby. It follows the model-view-controller (MVC) pattern and includes components like Action Pack, Active Support, Active Record, and Action Mailer. The document provides an overview of Rails, Ruby basics, installing Rails, the directory structure of a Rails application, and the MVC pattern.
CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar that makes JavaScript cleaner and adds features inspired by Python and Ruby. Key features include cleaner syntax for functions, objects, conditionals, loops, and classes. CoffeeScript code compiles directly to equivalent JavaScript code, so it can be used anywhere JavaScript is used like web browsers and Node.js. To use CoffeeScript, install the CoffeeScript compiler and use it to compile CoffeeScript files to JavaScript for use in projects.
This document provides an overview of Ruby for Java developers, covering the history and culture of both languages, their technical backgrounds, key differences in their languages and frameworks, and how Ruby on Rails works. It demonstrates Ruby concepts through examples and concludes with a discussion on performance and common use cases for each language.
It's a talk about how to write understandable code from understanding human brain at Taipei.py [1] and PyCon HK 2015 [2].
[1]: http://www.meetup.com/Taipei-py/events/222174472/
[2]: http://2015.pycon.hk/
CoffeeScript is a little language that compiles to JavaScript. It repairs confusing aspects of JavaScript while keeping its flexibility. The document discusses CoffeeScript types like numbers, strings, booleans, objects and functions. It also covers CoffeeScript concepts like variables, operators, expressions, statements, control flow, arrays, objects, loops, classes, inheritance and functions. CoffeeScript aims to expose the good parts of JavaScript in a simpler way.
This document provides an overview of JavaScript for PHP developers. It discusses JavaScript names, numbers, strings, variables, functions, objects, arrays, and problematic parts of JavaScript like semicolon insertion and parseInt. The document recommends reading Douglas Crockford's book "JavaScript: The Good Parts" to learn more about effectively using JavaScript.
The document provides techniques for designing beautiful Ruby APIs. It discusses 10 techniques: 1) argument processing, 2) code blocks, 3) module, 4) method_missing, 5) const_missing, 6) method chaining, 7) core extension, 8) class macro, 9) instance_eval, and 10) Class.new. For each technique, it provides examples of how it can be implemented and used to create clean, readable APIs in Ruby. It also includes a sub-talk on Ruby's object model and how metaprogramming works.
This presentation covers various "gotchas" or unexpected behaviors in Ruby that can trip up programmers. It begins with simple gotchas like string interpolation requiring double quotes and progresses to more advanced gotchas. Some of the gotchas discussed include: the difference between symbols and strings, truthy vs falsey values, constant reassignment only issuing a warning, class variable sharing between subclasses, block variable scoping, freezing arrays freezing contents but not elements, bang methods not always returning the expected value, and exceptions using raise/rescue rather than throw/catch. The presentation encourages watching out for these gotchas and referring back to it if Ruby behaves unexpectedly. It offers to add additional gotchas people encounter.
Code Fast, die() Early, Throw Structured ExceptionsJohn Anderson
Slides from a short talk given at January 2012 DC.pm. Covers "classic" exceptions in Perl as well as some libraries to make working with exceptions easier.
This document summarizes common Ruby "gotchas", or unexpected behaviors that can trip up developers. It covers topics like string interpolation requiring double quotes, truthiness of values other than false and nil, differences between symbols and strings, accessing characters in strings, variable scope in blocks, freezing arrays, and initializing arrays and hashes with the same object. The goal is to explain behaviors that may surprise those from other languages and help developers avoid potential pitfalls.
- Lazy printing in Perl loops can result in all dots/progress indicators printing at the end rather than each iteration due to buffering, but this can be fixed by using $|++ to flush the buffer after each print.
- Omitting brackets in Perl print statements can sometimes work but other times cause unexpected behavior, like concatenating strings unexpectedly, so brackets are best included for clarity.
- Perl's localtime function returns month numbers from 0-11 and day of week numbers with Sunday=0 rather than 1, so care needs to be taken to map these values correctly.
- Last used within a subroutine called in a loop can unexpectedly terminate the loop early.
The document introduces some simple Perl scripts to demonstrate basic Perl concepts like scalars, arrays, if/else statements, while and for loops, and print statements. It provides examples of 5 simple scripts - one that calculates the sum of numbers from 1 to 100 using a while loop, another that does the same using a for loop, a third that prints menu options from an array using a for loop, a fourth that makes a decision based on a hardcoded or user-input word, and a fifth that interacts with the user to make the same decision. It also covers comments, newline characters, short forms, syntax checking, and running the scripts.
This document provides instructions and sample code for Exercise 4 of Learn Python the Hard Way. The exercise introduces variables and variable names in Python.
The sample code defines several variables like cars, drivers, passengers, and uses them to calculate things like empty cars, carpool capacity, and average passengers per car. It prints the results.
The document provides extra credit tasks like adding comments to explain each line, reading the file backwards, finding typing errors, and researching floating point numbers. It also shows an example error when a variable is undefined.
ORUG - Sept 2014 - Lesson When Learning Ruby/Railsdanielrsmith
This document summarizes 10 things the author learned when switching to Ruby on Rails. 1) Ruby is not the same as Rails, and many people don't understand the difference between the language and framework. 2) It's important to understand how ActiveRecord works and the relationships between models and the database. 3) In Ruby, classes and modules are objects themselves. 4) Code in Ruby should read like English using blocks and following conventions like the Rails way.
This document provides an overview introduction to the Ruby programming language. It discusses what Ruby is, basic syntax, key features like being dynamically typed and object-oriented, implementations, applications, and the ecosystem. It also covers topics like variables, data types, control flow, methods, classes, and encapsulation. Code examples are provided to demonstrate various language constructs.
The document provides an overview of the Ruby programming language for Perl programmers. Some key points:
- Ruby is an object-oriented scripting language that is interpreted, not compiled. It draws influences from Perl, Smalltalk, Lisp, and C.
- Ruby supports features like classes, modules, blocks/iterators, exceptions, regular expressions and threads. Everything in Ruby is an object.
- Compared to Perl, Ruby is more object-oriented, dynamic, and has built-in support for threads. Syntax also differs in some key ways.
- The document provides examples of basic Ruby syntax like variables, loops, conditions, classes and modules to illustrate how the language works.
This document provides an overview of the Ruby programming language for Perl programmers. Ruby is an interpreted, object-oriented scripting language that is very similar to Perl in many ways, such as its syntax for regular expressions and control structures like loops and conditionals. However, Ruby differs from Perl in that it was designed from the start to be object-oriented and highly dynamic. The document discusses Ruby's core concepts like classes, modules, blocks and iterators in detail and provides many code examples to illustrate Ruby's syntax and features.
This document provides an introduction and overview of the Ruby programming language. It discusses Ruby's history and creator Yukihiro Matsumoto. It demonstrates basic Ruby syntax like integers, floats, strings, variables, methods, and flow control. It also covers Ruby classes, objects, and the interactive Ruby shell IRB. The document then introduces common Ruby libraries and frameworks like Sinatra for web development and Nokogiri for parsing HTML/XML. It includes code examples to demonstrate basic usage.
These are slides from a lecture on Red Flags in Programming that took place at an Israeli Open Source Developers meeting.
Red flags in programming are signs that you likely made a mistake with your application design or code.
Noticing and avoiding these mistakes help us write better code, at any language.
The subject related to mostly dynamic (higher level) languages, even though the sample code is in Perl.
Ruby on Rails is a popular web application framework written in Ruby. It follows the model-view-controller (MVC) pattern and includes components like Action Pack, Active Support, Active Record, and Action Mailer. The document provides an overview of Rails, Ruby basics, installing Rails, the directory structure of a Rails application, and the MVC pattern.
CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar that makes JavaScript cleaner and adds features inspired by Python and Ruby. Key features include cleaner syntax for functions, objects, conditionals, loops, and classes. CoffeeScript code compiles directly to equivalent JavaScript code, so it can be used anywhere JavaScript is used like web browsers and Node.js. To use CoffeeScript, install the CoffeeScript compiler and use it to compile CoffeeScript files to JavaScript for use in projects.
This document provides an overview of Ruby for Java developers, covering the history and culture of both languages, their technical backgrounds, key differences in their languages and frameworks, and how Ruby on Rails works. It demonstrates Ruby concepts through examples and concludes with a discussion on performance and common use cases for each language.
It's a talk about how to write understandable code from understanding human brain at Taipei.py [1] and PyCon HK 2015 [2].
[1]: http://www.meetup.com/Taipei-py/events/222174472/
[2]: http://2015.pycon.hk/
CoffeeScript is a little language that compiles to JavaScript. It repairs confusing aspects of JavaScript while keeping its flexibility. The document discusses CoffeeScript types like numbers, strings, booleans, objects and functions. It also covers CoffeeScript concepts like variables, operators, expressions, statements, control flow, arrays, objects, loops, classes, inheritance and functions. CoffeeScript aims to expose the good parts of JavaScript in a simpler way.
This document provides an overview of JavaScript for PHP developers. It discusses JavaScript names, numbers, strings, variables, functions, objects, arrays, and problematic parts of JavaScript like semicolon insertion and parseInt. The document recommends reading Douglas Crockford's book "JavaScript: The Good Parts" to learn more about effectively using JavaScript.
The document provides techniques for designing beautiful Ruby APIs. It discusses 10 techniques: 1) argument processing, 2) code blocks, 3) module, 4) method_missing, 5) const_missing, 6) method chaining, 7) core extension, 8) class macro, 9) instance_eval, and 10) Class.new. For each technique, it provides examples of how it can be implemented and used to create clean, readable APIs in Ruby. It also includes a sub-talk on Ruby's object model and how metaprogramming works.
This presentation covers various "gotchas" or unexpected behaviors in Ruby that can trip up programmers. It begins with simple gotchas like string interpolation requiring double quotes and progresses to more advanced gotchas. Some of the gotchas discussed include: the difference between symbols and strings, truthy vs falsey values, constant reassignment only issuing a warning, class variable sharing between subclasses, block variable scoping, freezing arrays freezing contents but not elements, bang methods not always returning the expected value, and exceptions using raise/rescue rather than throw/catch. The presentation encourages watching out for these gotchas and referring back to it if Ruby behaves unexpectedly. It offers to add additional gotchas people encounter.
Code Fast, die() Early, Throw Structured ExceptionsJohn Anderson
Slides from a short talk given at January 2012 DC.pm. Covers "classic" exceptions in Perl as well as some libraries to make working with exceptions easier.
This document summarizes common Ruby "gotchas", or unexpected behaviors that can trip up developers. It covers topics like string interpolation requiring double quotes, truthiness of values other than false and nil, differences between symbols and strings, accessing characters in strings, variable scope in blocks, freezing arrays, and initializing arrays and hashes with the same object. The goal is to explain behaviors that may surprise those from other languages and help developers avoid potential pitfalls.
- Lazy printing in Perl loops can result in all dots/progress indicators printing at the end rather than each iteration due to buffering, but this can be fixed by using $|++ to flush the buffer after each print.
- Omitting brackets in Perl print statements can sometimes work but other times cause unexpected behavior, like concatenating strings unexpectedly, so brackets are best included for clarity.
- Perl's localtime function returns month numbers from 0-11 and day of week numbers with Sunday=0 rather than 1, so care needs to be taken to map these values correctly.
- Last used within a subroutine called in a loop can unexpectedly terminate the loop early.
The document introduces some simple Perl scripts to demonstrate basic Perl concepts like scalars, arrays, if/else statements, while and for loops, and print statements. It provides examples of 5 simple scripts - one that calculates the sum of numbers from 1 to 100 using a while loop, another that does the same using a for loop, a third that prints menu options from an array using a for loop, a fourth that makes a decision based on a hardcoded or user-input word, and a fifth that interacts with the user to make the same decision. It also covers comments, newline characters, short forms, syntax checking, and running the scripts.
This document provides instructions and sample code for Exercise 4 of Learn Python the Hard Way. The exercise introduces variables and variable names in Python.
The sample code defines several variables like cars, drivers, passengers, and uses them to calculate things like empty cars, carpool capacity, and average passengers per car. It prints the results.
The document provides extra credit tasks like adding comments to explain each line, reading the file backwards, finding typing errors, and researching floating point numbers. It also shows an example error when a variable is undefined.
ORUG - Sept 2014 - Lesson When Learning Ruby/Railsdanielrsmith
This document summarizes 10 things the author learned when switching to Ruby on Rails. 1) Ruby is not the same as Rails, and many people don't understand the difference between the language and framework. 2) It's important to understand how ActiveRecord works and the relationships between models and the database. 3) In Ruby, classes and modules are objects themselves. 4) Code in Ruby should read like English using blocks and following conventions like the Rails way.
This document provides an overview introduction to the Ruby programming language. It discusses what Ruby is, basic syntax, key features like being dynamically typed and object-oriented, implementations, applications, and the ecosystem. It also covers topics like variables, data types, control flow, methods, classes, and encapsulation. Code examples are provided to demonstrate various language constructs.
CPAP.com Introduction to Coding: Part 1johnnygoodman
This document provides an introduction to coding concepts. It discusses storing values in variables and data types like strings and integers. Key coding concepts covered include comments, running code, comparisons, arrays, and if/else statements. The document outlines what future sessions will cover, including loops, classes, methods, connecting to databases, and using other people's code.
Six Feet Up's senior developer Clayton Parker will lead you on a journey to become a Python zen master. Your code should be as fashionable as it is functional. To quote the Zen of Python, "Beautiful is better than ugly". This talk will teach you about the Python style guide and why it is important. The talk will show you examples of well written Python and how to analyze your current code to make Guido proud.
This document provides an introduction and overview of Moose, a modern object framework for Perl 5. It begins with background on the author and a brief history of object oriented programming in Perl 5. It then explains what Moose is, including that it handles object overhead, allows for introspection, and is used in production software. Examples are provided of basic class creation and usage with Moose as well as more advanced features like attributes, types, subclassing, roles, method modifiers, and introspection. The benefits of Moose are summarized as writing less code and avoiding implementation details to have a better object model.
This document summarizes Adam Keys' presentation "Six Easy Pieces (Twice Over)", where he discusses important concepts for software developers based on Richard Feynman's lectures. The presentation is divided into two acts, where the first act from 2006 introduced non-syntactic aspects of Ruby and Rails, and the second act extracts the most important bits and argues they are applicable to all programmers. The concepts discussed include that programming should not suck, languages should make developers feel clever and powerful, the importance of building software with a balance of top-down and bottom-up approaches, keeping things simple, avoiding duplication, using testing as feedback, and how other languages can be borrowed from to write better code.
This document discusses programming languages and how computers execute code. It explains that high-level languages like Python, C++, and Java are translated into low-level machine language before the computer can run programs. It also discusses interpreters and compilers as tools that translate high-level code. The document then provides an introduction to the Python programming language, including basic Python vocabulary terms. It gives examples of Python code and explains concepts like variables, functions, operators, and data types.
Ruby is a dynamic, open source programming language that was created in the mid-1990s by Yukihiro Matsumoto. While it shares some similarities with .NET languages like C#, Ruby differs in that everything is an object, it is very flexible and forgiving, and it emphasizes programmer productivity. Ruby utilizes duck typing through modules and mixins rather than interfaces. Popular Ruby frameworks include Ruby on Rails for web development and libraries like Enumerable are implemented through mixins rather than interfaces. The Ruby ecosystem includes tools like RubyGems and testing frameworks like RSpec.
Six Feet Up's senior developer Clayton Parker will lead you on a journey to become a Python zen master. Your code should be as fashionable as it is functional. To quote the Zen of Python, "Beautiful is better than ugly". This talk will teach you about the Python style guide and why it is important. The talk will show you examples of well written Python and how to analyze your current code to make Guido proud.
The document summarizes basic concepts from Mr. Neighborly's Humble Little Ruby Book, including:
- What Ruby is and why learn it (a programming language and Ruby on Rails uses Ruby)
- Features that make Ruby special like object-oriented, interpreted, and automatic garbage collection
- Basic data types in Ruby like integers, floats, strings, arrays, hashes, ranges, and symbols
- How to define and manipulate various data types
This document provides an introduction and overview of the Ruby programming language. It discusses installing Ruby on Windows and Mac systems, data types including numbers, strings, and arrays. It also covers variables, arrays, iterators, methods including built-in and user-defined methods, and flow control including if/else conditional statements and while loops. The document encourages comments and feedback.
My talk from the pupet devops conference Berlin 2014 (http://code-your-config.com/). A low level tour of some terrible terrible puppet code, with advice on how to do it better (including showing off the awesome new each() construct you get in puppet 3.2)
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!
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
1. A Whirlwind Tour
The Whole Course in 20 Minutes
Friday, October 2, 2009
This is an introduction to Dynamic Academy's Perl Programming course. Just a flavor of some of
things you've learn in the course, in the next 20 minutes or so.
2. Where Are We Going?
• Let’s write a real program
• Use only techniques we’ll
learn in this class
• Show you where we’re
headed
Friday, October 2, 2009
I like starting off with a real example - not something trivial - even though much of it will be too fast
and I won't it explain it fully - but just to show off some of what perl can do, with a simple program,
written very quickly, that will actually work, so you can see where we're going in this course. And
everything here is something you learn in THIS course.
3. Eliza
dtreder% perl eliza.pl
Hello, I'm Elly. What would you like to discuss today?
my coffee
Who else is involved with that.
The barista burned it, I think. Perhaps she doesn't like my face.
Why do you think your face ?
Well, she can't see my legs.
When did you start noticing that.
Oh, back in 1988.
Tell me more about oh back in 1988 ?
That was high school for me.
Who else is involved with you ?
I'm innocent, I swear!
Why do you think that.
I'm a good person at heart.
Tell me more about you're a good person at heart ?
Well I haven't killed anybody. yet.
Why do you think you havent killed anybody yet
They're all still breathing.
Why don't we talk about your mother?
Alright, I confess! Professor Plum with the candlestick in the studio!
Tell me more about you confess...
Friday, October 2, 2009
Eliza was a program written in 1966 by Joseph Weizenbaum. It parodies Rogerian therapy - the old joke where the doctor just
rephrases and says back to you what you said yourself. There's been lots of rewrites : doctor.el in emacs is a reimplementation.
Obviously (after playing with it a minute) you can see it is mostly parroting your own phrases back to you, after some clean up.
so let's see if we can write this ourselves in perl, as a way of showing you what you can do with perl.
In fact everything you need to write this, you'll have by about midway through the first course.
4. Saying Hi
#!/usr/bin/perl
# Saying Hi
print "Hello, I'm Elly. What would you like
to discuss today?n";
# n - inside double quotes - means newline
Friday, October 2, 2009
Here's how perl starts. We tell the shell that we're writing a perl program, and print some text back to the user. What we're
printing goes inside the double quotes. There's one fancy thing here: the backslash n means newline. Perl is smart enough to
make this do the right thing no matter what your operating system is.
5. Saying Hi Back
# Get input from user
my $input = <>;
# introduce a new variable with my
# scalar variable $input holds a string
print “Why do you think $input ?n”;
# You can print variables too
Friday, October 2, 2009
The next part is we're going to get something the user types, and put that in a variable. You introduce a new variable with 'my',
and you can get input from the user with <>, which we pronounce as "diamond operator". And you can print variables you have
too. So this program asks a question, gets the repsonse, and parrots it back to the user.
6. Never Stop Trying
# loop as long as 1 is true (it always is!)
while (1) {
my $input = <>;
print “Why do you think $input ?n”;
}
Friday, October 2, 2009
So our program only asks one question. Let's put a loop around it, to make it keep asking questions, and parroting back. Now
we've got the basic structure - ask a question, print a response, ask again.
7. Never Stop Trying
while (1) {
my $input = <>;
# remove newline that the user typed
chomp $input;
print “Why do you think $input ?n”;
}
Friday, October 2, 2009
To control how the output looks, perl has a nifty builtin called chomp. It chomps off any newline in what the ser typed. The
user types in their sentence, and hits ENTER - so there's a new line on the end of his input. This chomps it off. Again perl is
smart enough to do the right thing here, even though windows and linux do different things to make a newline.
8. I can say lots of things
# An array of some canned responses
my @canned = ('Tell me more about',
'Why do you think',
'What else is going on with',
'Who else is involved with',
'When did you start noticing',
'How did you feel about');
# you can also put strings in single quotes
Friday, October 2, 2009
So we had a variable that could hold one thing. An array is a variable that can hold more than one thing - zero or more. Perl's
tradition is no built in limits - so an array can hold as many things as you want, and you don't have to say in advance how many.
These strings use single quotes.
9. Polly Wanna Cracker
while (1) {
my $input = <>;
chomp $input;
# a number from 0 to 5
my $i = rand(6);
# access one bucket of an array
print $canned[$i];
}
Friday, October 2, 2009
So, let's pick one at random from our canned responses, and print one of those. I get a random number, between 0 and 5, then
print out that response. Here's how I look up one bucket from that array.
10. Fake Like I’m Awake
while (1) {
my $input = <>;
chomp $input;
my $i = rand(6);
# separate things to print with commas
print $canned[$i], “ $input ?n”;
# prints “Tell me more about $input?”
}
Friday, October 2, 2009
I can print more than one thing - separate the arguments to print with a comma.
11. We Must Discuss
my $count = 0;
while (1) {
my $input = <>;
chomp $input;
$count++;
if ($count > 10) {
print “Why don’t we talk about your mother?n”;
next;
}
Friday, October 2, 2009
(demo) Ok, so that's working. Now here's an idea, from the original ELIZA chatbot. If the user doesn't mention his mother
within 10 questions, let's bring it up. Here's a variable to keep track, ++ adds one every time. After we get to 10, print this
question. Then, the "next" says skip to the top of the loop again.
12. But Only Once
my $count = 0;
my $parents = 0;
while (1) {
my $input = <>;
chomp $input;
$count++;
if ($count > 10 && ! $parents) {
print “Why don’t we talk about your mother?n”;
$parents = 1;
next;
}
Friday, October 2, 2009
(demo) well, that's not exactly right. After 10, that one keeps asking the same quesiton. So we need another variable to track
that we already asked it, and at that point stop asking. Set parents to 1, and if it's true, don't ask. So this conditional says, if the
count is more than ten, and parents is NOT true. The ! (pronounced 'bang') means NOT true. And setting to 1, in perl, is true.
13. I Already Told You!
my $count = 0;
my $parents = 0;
while (1) {
my $input = <>;
chomp $input;
# =~ m! ! means matches this regular expression
if ($input =~ m!b(mom|mamma|mother)b!) {
$parents = 1;
}
$count++;
if ($count > 10 && ! $parents) {
print “Why don’t we talk about your mother?n”;
Friday, October 2, 2009
And if the user DOES mention his mother, let's not ask the question. Here's how we check. In perl this is called a "regular
expression" (though that's a bit of a misnomer, which I'll explain later). This one says m! for match, then b means "word
boundary" - meaning, it has to start a new word, either at the beginning or have a space between it and another word. The |
(pronounced "pipe") means OR. So it says there has to be a word "mom" or "mamma" or "mother" as a standalone word in the
sentence. In other words "cardamom" won't match, but "my mamma doesn't understand me" would match.
14. Clean Up Your Act
while (1) {
my $input = <>;
chomp $input;
# put it in lowercase
$input = lc($input);
# get rid of all punctuation
$input =~ s! [^ws] !!gx;
# w is “word characters” - 0-9, A-Z, _
# s is “whitespace” - space, tab, newline
# [^ ] means everything that isn’t
# g means GO: over and over
# x means whitespace isn't taken literally
Friday, October 2, 2009
Not everyone is going to type "mom" and not "Mom", so we need to add something to say "lowercase it all first" - that's lc(). The
s! means substitute, replace anything of the left with what's on the right. In fact, on the right we have nothing (!!) has nothing
between the bangs, so it says find anything NOT a word, and not a space, and replace them with nothing - remove them. g
means don't stop at the first one - keep going and remove any more you find. And the x means I'm allowed to put some
whitespace into my regex just to keep it readable.
15. It’s Not You, It’s Me
# Change you -> me and vice versa,
# leaving a marker (#) to show those changed
$input =~ s! b you b !#me!gx;
$input =~ s! b your !#my!gx;
$input =~ s! b you’re !#I am!gx;
$input =~ s! b my !#your!gx;
$input =~ s! b mine b !#yours!gx;
$input =~ s! b me b !#you!gx;
$input =~ s! b i b !#you!gx;
$input =~ s! b im b !#you're!gx;
# remove all the markers
$input =~ s!#!!g;
Friday, October 2, 2009
I could use regular expressions and substitutions to change lots of the phrases to something that makes more conversational
sense. If the user types "I love you" we want to write back something like "why do you say you love me?" - switch I to you and
you to me. What these ones do is take out one word : and replace it with another (and a marker, this # (pronounced "pound")
sign. I could've used any character, but I used the # because I don't think anyone's going to type it. The marker is just there to
prevent you from changing to me and then me back to you again - the marker stops the second change. Then once I've
changed everything, I just remove all the markers.
16. Clean Up Your Act
while (1) {
my $input = <>;
chomp $input;
$input =~ s![^ws]!!g;
$input = lc($input);
# user didn't type anything!
if (! $input) {
print "I'd like to hear what you think.n";
next;
}
Friday, October 2, 2009
And, maybe one final feature - if the user types nothing at all, I've coded in a special response. You could add lots more
features - we got all this done in about twenty minutes with perl, and it actually works.
17. Congratulations!
• We covered:
• Scalars and Arrays
• Input and Output
• Control structures such
as if and while
• Regular expressions and
substitutions
Friday, October 2, 2009
18. Other Stuff
• Things we didn’t cover
here, but we’ll still do:
• Hashes
• Files on disk
• Dates and times
• Subroutines
Friday, October 2, 2009
see also chatbot::eliza from wikipedia eliza.
http://search.cpan.org/dist/Chatbot-Eliza/Chatbot/Eliza.pm