This document provides an introduction and overview of the Perl programming language. It discusses Perl's history and popularity, data types like scalars, arrays, and hashes, control structures, loops, functions, and common string and time manipulation functions. The tutorial aims to introduce basic Perl concepts like variables, printing, and functions through a simple "Hello World" example. It also outlines pros and cons of Perl for scripting and highlights some of its strengths in text processing.
This document provides a tutorial on the Perl programming language. It covers basic Perl concepts like numbers, strings, variables, arrays, and control structures. Key points include double-precision numbers, single and double-quoted strings, scalar and array variables, comparison and logical operators, and functions for input/output, flow control and array manipulation. The document aims to teach Perl fundamentals through examples and exercises.
PHP for Adults: Clean Code and Object CalisthenicsGuilherme Blanco
The document discusses principles and techniques for writing clean code in PHP, including:
- The S.O.L.I.D. principles for object-oriented design (single responsibility, open/closed, Liskov substitution, etc.)
- Object calisthenics rules for PHP functions/methods like using single indentation levels and early returns.
- Refactoring code examples to follow these principles and rules to improve readability, maintainability and testability of PHP code.
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
This document provides an overview of the Perl programming language and includes examples of common Perl constructs. It discusses getting started with Perl, printing, variables, arrays, loops, conditionals, regular expressions, file handling and subroutines. Code snippets are provided to demonstrate various Perl features such as accessing array elements, for/while loops, pattern matching with regular expressions, splitting strings, and defining subroutines.
This document provides an overview of key Perl concepts including scalars, arrays, hashes, I/O, operators, and control structures. It discusses scalar data types like strings and numbers. It also covers arrays, hashes, and common functions for each. The document outlines I/O with the console, files, and handles. It briefly summarizes operators and precedence. Finally, it discusses control structures like if/else, loops, and modifiers.
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
This document provides a tutorial on the Perl programming language. It covers basic Perl concepts like numbers, strings, variables, arrays, and control structures. Key points include double-precision numbers, single and double-quoted strings, scalar and array variables, comparison and logical operators, and functions for input/output, flow control and array manipulation. The document aims to teach Perl fundamentals through examples and exercises.
PHP for Adults: Clean Code and Object CalisthenicsGuilherme Blanco
The document discusses principles and techniques for writing clean code in PHP, including:
- The S.O.L.I.D. principles for object-oriented design (single responsibility, open/closed, Liskov substitution, etc.)
- Object calisthenics rules for PHP functions/methods like using single indentation levels and early returns.
- Refactoring code examples to follow these principles and rules to improve readability, maintainability and testability of PHP code.
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
This document provides an overview of the Perl programming language and includes examples of common Perl constructs. It discusses getting started with Perl, printing, variables, arrays, loops, conditionals, regular expressions, file handling and subroutines. Code snippets are provided to demonstrate various Perl features such as accessing array elements, for/while loops, pattern matching with regular expressions, splitting strings, and defining subroutines.
This document provides an overview of key Perl concepts including scalars, arrays, hashes, I/O, operators, and control structures. It discusses scalar data types like strings and numbers. It also covers arrays, hashes, and common functions for each. The document outlines I/O with the console, files, and handles. It briefly summarizes operators and precedence. Finally, it discusses control structures like if/else, loops, and modifiers.
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
This document provides an introduction and overview of DBIx::Class, an ORM (object relational mapper) for Perl. It discusses setting up tables for an authors and books example database, and performing CRUD (create, read, update, delete) operations both manually using SQL and using DBIx::Class. It also covers creating models with Schema::Loader, debugging, overloading result and result set classes, and inflating/deflating columns.
Strings in PHP can represent text data and be manipulated using a variety of functions. Strings can be interpolated with variable values, accessed as arrays to retrieve individual characters, searched using functions like strpos(), and formatted for output. Common string operations include searching, replacing, comparing values, and extracting/modifying substrings.
Code smell is any symptom in the source code of a program that possibly indicates a deeper problem.
So let's see what are code smell we can remove from our code.
Some techniques from the heady world of Functional Programming implemented in idiomatic Perl using various techniques: closures, iterators, Devel::Declare, and some distilled evil. New version now with monads! (As presented at http://conferences.yapceurope.org/lpw2008/ )
The document provides tips for writing simple, readable code that is easy to maintain and adapt to changes over time. It emphasizes keeping code well-structured with small, single-purpose functions and classes, using good naming conventions, testing code, and designing for flexibility through techniques like dependency injection and interfaces. The document also encourages practicing code through katas and code reviews to improve coding skills.
PHP strings allow storing and manipulating text data. A string is a series of characters that can contain any number of characters limited only by available memory. Strings can be written using single quotes, double quotes, or heredoc syntax. Special characters in strings must be escaped using a backslash. PHP provides many built-in functions for working with strings like concatenation, comparison, searching, replacing, extracting, splitting, joining, formatting and more. Regular expressions provide powerful pattern matching capabilities for strings and PHP has functions like preg_match() for searching strings using regex patterns.
PHP is a server-side scripting language that is embedded into HTML files. The goal is to generate client-side code like HTML, CSS, and JavaScript. PHP files are executed on the web server and must be saved in a subdirectory that is accessible to the server, like /var/www. PHP allows variables, operators, conditional statements, loops, functions, and arrays. Sessions and cookies can be used to store and retrieve information across multiple requests.
An Elephant of a Different Colour: HackVic Metcalfe
Slides from my GTA-PHP Meetup talk about Hack which is the Facebook version of the PHP programming language which runs under their HHVM runtime environment for PHP. The focus of my talk was the language improvements that the Facebook team has added to PHP.
There's a lot of information in the presenter's notes, so if you're interested in Hack scroll down to see the extras.
This document discusses PHP functions and arrays. It covers basic syntax for defining functions, returning values from functions, and variable scope. It also covers array basics like indexing and printing arrays, as well as operations like sorting, searching, and iterating over arrays. Functions for stacks, queues and sets using arrays are also demonstrated. The document is a comprehensive reference for working with functions and arrays in PHP.
If your not using an ORM (object relational mapper) and are still writing SQL by hand, here's what you need to know.
An introduction into DBIx::Class and some of the concepts and goodies you should be aware off.
The document discusses various PHP concepts including iterators, generators, arrays, and performance. It provides examples of using iterators, generators, and default array functions to iterate over arrays and collections. It also compares the readability and performance of these different approaches. The document suggests that generators can help avoid memory issues by evaluating sequences lazily without building entire arrays in memory.
This document summarizes Python basics including its features, popularity in different fields and companies, data types, control flow, containers like lists and dictionaries, NumPy for numerical computing, and classes. Python is an interpreted, general-purpose language with rich library support. It is commonly used in computer science, data analysis, biology, and academic communities. Major companies like Google, Dropbox, and Instagram use Python.
This document summarizes Python basics including its features, popularity in different fields and companies, data types, control flow, containers like lists and dictionaries, NumPy for numerical computing, and classes. Python is an interpreted, general-purpose language with rich library support. It is commonly used in computer science, data analysis, biology, and academic communities. Major companies like Google, Dropbox, and Instagram use Python.
- Color saturation refers to the purity or intensity of a color, with more saturated colors appearing bolder.
- Photoshop's color picker tool allows users to visually see and adjust the saturation level of any color from 0-100%.
- While saturation can enhance images by making colors appear more intense and beautiful, Photoshop's standard saturation tools are limited. This document will explain how to create and use saturation masks to target saturation adjustments precisely.
The document discusses how to prevent JavaScript injection attacks in ASP.NET MVC applications. It describes a customer feedback website that is vulnerable to JavaScript injection by displaying user-submitted content without encoding. It then presents two approaches to prevent this: 1) HTML encoding user data when displayed in views, and 2) HTML encoding user data before saving to the database in controllers. Encoding replaces dangerous HTML characters to neutralize malicious JavaScript while preserving the data's meaning.
This document provides instructions for updating PHP on Mac OS X Server 10.4.x. It discusses what is installed by default, requirements for updating, and steps for installing the latest versions of PHP4 and PHP5. Key steps include downloading, compiling, and installing new versions of PHP while retaining Server Admin functionality. Caveats around MySQL passwords, php.ini configuration, and using only one PHP version at a time are also covered.
The document introduces CSS and how it works with HTML to separate content from presentation, allowing the styling of web pages through rules that target HTML elements. It explains CSS syntax and various selectors like type, class, ID, and descendant selectors. Examples are provided of how CSS can be used to style properties like color, font, padding, and layout of elements on a page.
This document discusses converting color digital images to black and white prints. It begins with an introduction to black and white digital image making and the skills required. It then covers translating color images to monochrome, including what the grayscale is and how color is converted to tones. Various methods for converting color to black and white in Photoshop CS3 are presented. Techniques for fine-tuning black and white images, adding effects like toning, and achieving the final black and white print are also examined.
The document discusses tools and standards for improving interoperability between systems exchanging information. It describes an approach using open standards like XML, XSD and CAM to generate documentation and test cases from an XSD schema to create an "Information Exchange Package" for validating interoperability. The tutorial explains how to use the jCAM editor to ingest an XSD schema, document exchange patterns by creating a "want list", generate a subset XSD and test cases, and run conformance testing to verify interoperability.
TopStyle Help & <b>Tutorial</b>tutorialsruby
This document provides a table of contents for the TopStyle Pro Help & Tutorial, which teaches how to use the TopStyle software for editing style sheets and HTML/XHTML documents. It lists over 50 sections that provide explanations and instructions for features like creating and opening files, editing styles, working with colors, previews, validation, site management, reports and customizing the software. The document was created by Giampaolo Bellavite from the online help provided with TopStyle version 3.11.
This document provides an introduction and overview of DBIx::Class, an ORM (object relational mapper) for Perl. It discusses setting up tables for an authors and books example database, and performing CRUD (create, read, update, delete) operations both manually using SQL and using DBIx::Class. It also covers creating models with Schema::Loader, debugging, overloading result and result set classes, and inflating/deflating columns.
Strings in PHP can represent text data and be manipulated using a variety of functions. Strings can be interpolated with variable values, accessed as arrays to retrieve individual characters, searched using functions like strpos(), and formatted for output. Common string operations include searching, replacing, comparing values, and extracting/modifying substrings.
Code smell is any symptom in the source code of a program that possibly indicates a deeper problem.
So let's see what are code smell we can remove from our code.
Some techniques from the heady world of Functional Programming implemented in idiomatic Perl using various techniques: closures, iterators, Devel::Declare, and some distilled evil. New version now with monads! (As presented at http://conferences.yapceurope.org/lpw2008/ )
The document provides tips for writing simple, readable code that is easy to maintain and adapt to changes over time. It emphasizes keeping code well-structured with small, single-purpose functions and classes, using good naming conventions, testing code, and designing for flexibility through techniques like dependency injection and interfaces. The document also encourages practicing code through katas and code reviews to improve coding skills.
PHP strings allow storing and manipulating text data. A string is a series of characters that can contain any number of characters limited only by available memory. Strings can be written using single quotes, double quotes, or heredoc syntax. Special characters in strings must be escaped using a backslash. PHP provides many built-in functions for working with strings like concatenation, comparison, searching, replacing, extracting, splitting, joining, formatting and more. Regular expressions provide powerful pattern matching capabilities for strings and PHP has functions like preg_match() for searching strings using regex patterns.
PHP is a server-side scripting language that is embedded into HTML files. The goal is to generate client-side code like HTML, CSS, and JavaScript. PHP files are executed on the web server and must be saved in a subdirectory that is accessible to the server, like /var/www. PHP allows variables, operators, conditional statements, loops, functions, and arrays. Sessions and cookies can be used to store and retrieve information across multiple requests.
An Elephant of a Different Colour: HackVic Metcalfe
Slides from my GTA-PHP Meetup talk about Hack which is the Facebook version of the PHP programming language which runs under their HHVM runtime environment for PHP. The focus of my talk was the language improvements that the Facebook team has added to PHP.
There's a lot of information in the presenter's notes, so if you're interested in Hack scroll down to see the extras.
This document discusses PHP functions and arrays. It covers basic syntax for defining functions, returning values from functions, and variable scope. It also covers array basics like indexing and printing arrays, as well as operations like sorting, searching, and iterating over arrays. Functions for stacks, queues and sets using arrays are also demonstrated. The document is a comprehensive reference for working with functions and arrays in PHP.
If your not using an ORM (object relational mapper) and are still writing SQL by hand, here's what you need to know.
An introduction into DBIx::Class and some of the concepts and goodies you should be aware off.
The document discusses various PHP concepts including iterators, generators, arrays, and performance. It provides examples of using iterators, generators, and default array functions to iterate over arrays and collections. It also compares the readability and performance of these different approaches. The document suggests that generators can help avoid memory issues by evaluating sequences lazily without building entire arrays in memory.
This document summarizes Python basics including its features, popularity in different fields and companies, data types, control flow, containers like lists and dictionaries, NumPy for numerical computing, and classes. Python is an interpreted, general-purpose language with rich library support. It is commonly used in computer science, data analysis, biology, and academic communities. Major companies like Google, Dropbox, and Instagram use Python.
This document summarizes Python basics including its features, popularity in different fields and companies, data types, control flow, containers like lists and dictionaries, NumPy for numerical computing, and classes. Python is an interpreted, general-purpose language with rich library support. It is commonly used in computer science, data analysis, biology, and academic communities. Major companies like Google, Dropbox, and Instagram use Python.
- Color saturation refers to the purity or intensity of a color, with more saturated colors appearing bolder.
- Photoshop's color picker tool allows users to visually see and adjust the saturation level of any color from 0-100%.
- While saturation can enhance images by making colors appear more intense and beautiful, Photoshop's standard saturation tools are limited. This document will explain how to create and use saturation masks to target saturation adjustments precisely.
The document discusses how to prevent JavaScript injection attacks in ASP.NET MVC applications. It describes a customer feedback website that is vulnerable to JavaScript injection by displaying user-submitted content without encoding. It then presents two approaches to prevent this: 1) HTML encoding user data when displayed in views, and 2) HTML encoding user data before saving to the database in controllers. Encoding replaces dangerous HTML characters to neutralize malicious JavaScript while preserving the data's meaning.
This document provides instructions for updating PHP on Mac OS X Server 10.4.x. It discusses what is installed by default, requirements for updating, and steps for installing the latest versions of PHP4 and PHP5. Key steps include downloading, compiling, and installing new versions of PHP while retaining Server Admin functionality. Caveats around MySQL passwords, php.ini configuration, and using only one PHP version at a time are also covered.
The document introduces CSS and how it works with HTML to separate content from presentation, allowing the styling of web pages through rules that target HTML elements. It explains CSS syntax and various selectors like type, class, ID, and descendant selectors. Examples are provided of how CSS can be used to style properties like color, font, padding, and layout of elements on a page.
This document discusses converting color digital images to black and white prints. It begins with an introduction to black and white digital image making and the skills required. It then covers translating color images to monochrome, including what the grayscale is and how color is converted to tones. Various methods for converting color to black and white in Photoshop CS3 are presented. Techniques for fine-tuning black and white images, adding effects like toning, and achieving the final black and white print are also examined.
The document discusses tools and standards for improving interoperability between systems exchanging information. It describes an approach using open standards like XML, XSD and CAM to generate documentation and test cases from an XSD schema to create an "Information Exchange Package" for validating interoperability. The tutorial explains how to use the jCAM editor to ingest an XSD schema, document exchange patterns by creating a "want list", generate a subset XSD and test cases, and run conformance testing to verify interoperability.
TopStyle Help & <b>Tutorial</b>tutorialsruby
This document provides a table of contents for the TopStyle Pro Help & Tutorial, which teaches how to use the TopStyle software for editing style sheets and HTML/XHTML documents. It lists over 50 sections that provide explanations and instructions for features like creating and opening files, editing styles, working with colors, previews, validation, site management, reports and customizing the software. The document was created by Giampaolo Bellavite from the online help provided with TopStyle version 3.11.
The document introduces HTML forms and how to generate different form elements like buttons, text fields, checkboxes, and drop-down menus using tags like <form>, <input>, and <select>. It provides code examples for generating each element and linking an external CSS file to style the elements. The document also notes that while HTML can generate these form elements, additional scripts like JavaScript are needed to make the forms interactive and functional.
This document provides an overview of the Perl programming language and includes examples of common Perl scripts and functions. It discusses getting started with Perl, printing, variables, arrays, loops, conditionals, regular expressions, file handling and subroutines. Code snippets are provided to demonstrate concepts like opening and reading files, splitting strings, calculating averages and more. The document serves as a tutorial for beginners to learn the basics of Perl programming.
The document summarizes a Perl Mongers course on data and operators in Perl. It covers basic data types like scalars, arrays, and hashes. It describes strings, numbers, and how to perform operations on them. It also discusses control structures like conditionals and loops for program flow. Finally, it mentions input/output functions like STDIN and STDOUT.
This document provides a summary of a lecture on advanced Perl programming. It discusses how to sort arrays numerically and in descending order, explains the difference between the 'chop' and 'chomp' functions, and shows how to read from one file and write to another with line numbers. It also reviews how Perl evaluates Boolean expressions, the meaning of the <ARGV> file handle, and how to exit a loop using constructs like 'last' and 'next'. Quiz questions are provided to test comprehension of topics covered in the lecture.
This document provides an overview of the Perl programming language. It discusses key Perl concepts like numbers, strings, variables, arrays, comparison operators, and control structures. Some key points covered include how Perl handles numeric and string data types, how to define and assign variables, how to perform basic operations on numbers and strings, and how to use common control structures like if/else, while loops, and foreach loops. The document also provides examples of working with arrays and lists in Perl.
Perl is a high-level scripting language useful for tasks like parsing and restructuring data files, CGI scripts, and more. It was created in 1987 by Larry Wall as a "glue" language to connect systems. Perl code is compiled at runtime. Key features include regular expressions, hashes for associative arrays, object-oriented capabilities, and extensive standard and third-party libraries. Perl uses C-like syntax and data types like scalars, lists, and hashes. It supports control structures like if/else, for loops, and subroutines for modular programming. Perl is well-suited for text manipulation and system administration tasks.
This document provides an overview of the Perl programming language. It introduces key Perl concepts like data types, scalars, arrays, hashes, flow control, input/output, and operators. Perl allows variables to be of any type and handles automatic type conversion. It supports common data structures like arrays and associative arrays (hashes). Subroutines provide modularity and scoping rules determine variable visibility. Perl scripts can process command line arguments, files, and network connections.
This document provides a brief summary of Perl programming concepts including scalars, arrays, regular expressions, file handling, control structures, and functions. It covers basic syntax such as using semicolons, comments, variables, operators, and built-in variables. Array manipulation like indexing, pushing, and popping elements is described. File I/O using open, close and reading from files or standard streams is outlined. Common control structures like if/else, foreach, and while are listed along with comparison and logical operators. Regular expressions for pattern matching and substitution are covered including special characters.
This document provides a brief summary of Perl programming concepts including scalars, arrays, regular expressions, file handling, control structures, and functions. It covers basic syntax such as using semicolons, comments, variables, operators, and built-in variables. Array manipulation like indexing, pushing, and popping elements is described. File I/O using open, close and reading from files or standard streams is outlined. Common control structures like if/else, for loops, and while loops are listed. Regular expressions for pattern matching and substitution are summarized along with special characters. Miscellaneous functions and defining subroutines are also mentioned.
This document provides a brief summary of Perl programming concepts including scalars, arrays, regular expressions, file handling, control structures, and functions. It covers basic syntax such as using semicolons, comments, variables, operators, and built-in variables. Array manipulation like indexing, pushing, and popping elements is described. File I/O using open, close and reading from files or standard streams is outlined. Common control structures like if/else, foreach, and while are listed along with comparison and logical operators. Regular expressions for pattern matching and substitution are covered including special characters.
This document provides a brief summary of Perl programming concepts including scalars, arrays, regular expressions, file handling, control structures, and functions. It covers basic syntax such as using semicolons, comments, variables, operators, and built-in variables. Array manipulation like indexing, pushing, and popping elements is described. File I/O using open, close and reading from files or standard streams is outlined. Common control structures like if/else, foreach, and while are listed along with comparison and logical operators. Regular expressions for pattern matching and substitution are covered including special characters.
The document discusses various techniques for extending and improving Perl, including both good and potentially evil techniques. It covers Perl modules that port Perl 6 features to Perl 5 like given/when switches and state variables. It also discusses techniques for runtime introspection and modification like PadWalker and source filters. The document advocates for continuing to extend Perl 5 with modern features to keep it relevant and powerful.
The document provides an overview of the topics to be covered in a basic Perl programming course, including an introduction to Perl, variables, control structures, loops, subroutines, regular expressions, Boolean logic, and file handling. The agenda lists the main topics as Perl introduction, variables, control structures, loops, defining and using subroutines, regular expressions, using Boolean logic for true/false conditions, and file handling. Examples are then provided for many of the programming concepts.
This document provides an overview of PHP (Hypertext Preprocessor), a popular server-side scripting language used for web development. It discusses key PHP concepts like server-side scripting, inclusion of files, syntax, variables, arrays, operators, functions, branching, looping, forms, MySQL integration, sessions, and cookies. The document is intended to help beginners get started with PHP.
This document provides an overview of data types in Perl, including scalars, arrays, and hashes. Scalars can hold single numeric or string values and are denoted with a dollar sign. Arrays hold collections of scalar values and are denoted with an at sign. Hashes store key-value pairs and are denoted with a percent sign. The document provides examples of declaring and accessing each data type, and describes common operations like sorting, iterating with foreach loops, and adding/removing elements from arrays.
This document provides an overview of the Perl programming language. It covers what Perl is, how to create and run Perl scripts, scalar and array variables, hashes, control structures like if/else and loops, file operations, and common Perl functions like split and join. Advanced Perl concepts like subroutines, regular expressions, and object-oriented programming are also mentioned. Resources for learning more about Perl like documentation, books, and mailing lists are provided at the end.
Crash Course in Perl – Perl tutorial for C programmersGil Megidish
Perl is an interpreted programming language created by Larry Wall in 1987. It has been in production longer than PHP, Java, and Ruby. Perl is loosely typed and supports scalars, arrays, hashes, and references. It has a large collection of modules available on CPAN that make it suitable for tasks ranging from databases to web development. Perl code is portable across operating systems and has a friendly community for support.
Perl is an interpreted programming language created in 1987 that provides powerful text processing capabilities. It is portable, supports rapid prototyping, and follows the philosophy of "there's more than one way to do it". To use Perl, it needs to be installed which is usually already done on Linux and Mac systems. Common Perl data types include numbers, strings, and scalar variables to store single values. Perl includes typical operators for mathematics and strings, and conditional statements like if/else to control program execution based on comparisons.
This document provides an introduction to the Perl programming language, including:
- A brief history of Perl's development and origins drawing from other languages like C and shell scripting.
- An overview of the major Perl versions released since 1987.
- Descriptions of Perl's basic program structure, data types, control structures, input/output capabilities, functions, and object-oriented features like encapsulation and inheritance.
- Examples are provided to illustrate Perl's syntax and capabilities for variables, comments, arithmetic, strings, arrays, hashes, conditionals, loops, file handling and defining custom functions.
- The document concludes by providing a link to a demo Perl project online.
Full-day tutorial for the dutch php conference 2011 giving a very quick tour around all the various areas of the ZCE syllabus and some tips on the exam styles
This document provides an overview of common Perl programming constructs including:
- Variables (scalars, arrays, hashes) and assignment
- Arithmetic, logical, and comparison operators
- Conditional statements and loops
- Input/output functions
- String, array, and regular expression functions
It also gives examples of Perl programs for calculating the reverse complement of a DNA sequence and implementing an exact sequence matching algorithm.
This document provides a help and tutorial for TopStyle Pro version 3.11. It covers getting started with TopStyle, editing style sheets and HTML/XHTML, working with colors, previews, validation, site management, reports, mappings, customization, and third-party integration. It also includes appendices on CSS basics and tips, TopStyle tips and tricks, style sheet resources, keyboard shortcuts, and regular expressions.
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>tutorialsruby
This document provides the course outline for IMD 210 Fundamentals of Scripting Languages at The Art Institute of Atlanta during the Spring 2005 quarter. The course focuses on integrating programming concepts with interface design using scripting languages like JavaScript and CSS. It will cover topics like DOM, CSS layout, JavaScript variables, conditionals, and events. Students will complete 4 assignments including redesigning existing websites, and there will be weekly quizzes, a midterm, and final exam. The course is worth 4 credits and meets once a week for class and lab.
This document provides the course outline for IMD 210 Fundamentals of Scripting Languages at The Art Institute of Atlanta during the Spring 2005 quarter. The course focuses on integrating programming concepts with interface design using scripting languages like JavaScript and CSS. It will cover topics like DOM, CSS layout, JavaScript variables, conditionals, and events. Students will complete 4 assignments including redesigning existing websites, and there will be weekly quizzes, a midterm, and final exam. The course is worth 4 credits and meets once a week for class and lab.
The group aims to bridge gaps between peer-to-peer database architectures and scaling multimedia information retrieval. They develop a probabilistic multimedia database system with abstraction layers for applications and researchers. They also research challenges of peer-to-peer networks for distributed data management. Both lines are supported by the MonetDB platform to exploit custom hardware and adaptive query optimization. The goal is a modular solution linking theoretical optimal solutions to application demands under resource limitations.
Standardization and Knowledge Transfer – INS0tutorialsruby
The group aims to bridge gaps between peer-to-peer database architectures and scaling multimedia information retrieval. They develop a probabilistic multimedia database system with abstraction layers and a flexible model. They also research challenges of peer-to-peer networks for distributed data management. Both lines are supported by the MonetDB platform to exploit custom hardware and adaptive query optimization. The goal is a modular solution linking theoretical optimal solutions to application demands under resource limitations.
This document provides an introduction to converting HTML documents to XHTML, including the basic syntax changes needed like making all tags lowercase and closing all tags. It provides examples of correct XHTML markup for different tags. It also explains the new DOCTYPE declaration and shows a sample well-formed XHTML document incorporating all the discussed changes. Resources for learning more about XHTML are listed at the end.
This document provides an introduction to converting HTML documents to XHTML, including the basic syntax changes needed like making all tags lowercase and closing all tags. It provides examples of correct XHTML markup for different tags. It also explains the new DOCTYPE declaration and shows a sample well-formed XHTML document incorporating all the discussed changes. Resources for learning more about XHTML are listed at the end.
XHTML is a markup language that provides structure and semantics to web pages. It is based on XML and is more strict than HTML. XHTML pages must have a document type definition, html and head tags, and a body where the visible content goes. Common XHTML tags include paragraphs, lists, links, images, and divisions to logically separate content. While XHTML provides structure, CSS is used to style pages and control visual presentation by defining rules for tags. CSS rules are defined in external style sheets to keep presentation separate from structure and content.
XHTML is a markup language that provides structure and semantics to web pages. It is based on XML and is more strict than HTML. XHTML pages must have a document type definition, html and head tags, and a body where the visible content goes. Common XHTML tags include paragraphs, lists, links, images, and divisions to logically separate content. While XHTML provides structure, CSS is used to style pages and control visual presentation through rules that target specific XHTML elements.
This document discusses how to create and use external cascading style sheets (CSS) in Dreamweaver. It provides steps to:
1. Open the CSS Styles tab in Dreamweaver and create a new external CSS stylesheet using a sample text style.
2. Save the stylesheet and link it to a new HTML page to style elements like headings, text sizes, and boxes.
3. Edit existing styles by selecting a tag in the CSS Styles panel and modifying properties directly, or by clicking the tag and using the pencil icon to edit in a window. This allows customizing styles globally across all linked pages.
This document provides an overview of how to create and use cascading style sheets (CSS) in Dreamweaver. It describes the different types of style sheets, including external and internal style sheets. It outlines the steps to create an external style sheet in Dreamweaver using the CSS Styles panel and provides instructions for linking the external style sheet to an HTML page. The document demonstrates how to experiment with predefined styles and how to edit, add, and delete styles in the CSS stylesheet.
This document appears to be a weekly update from an intro to computer science course. It includes summaries of classmates' demographics, comfort levels, and prior experience. It also discusses time spent on problem sets and recommends upcoming courses in CS51 and CS61. Finally, it recommends reading on TCP/IP, HTTP, XHTML, CSS, PHP, SQL and using the bulletin board for questions.
This document appears to be a weekly update from an intro to computer science course. It includes summaries of classmates' demographics, comfort levels, and prior experience. It also discusses time spent on problem sets and recommends upcoming courses in CS51 and CS61. Finally, it recommends reading on topics like TCP/IP, HTTP, XHTML, CSS, PHP, SQL and using bulletin boards, and includes images related to these topics.
The document discusses how to use Cascading Style Sheets (CSS) with Corvid Servlet Runtime templates to control formatting and layout. CSS allows separating design from content, making templates simpler and easier to maintain. It also enables adapting appearance for different devices. The document provides examples of using CSS classes to style template elements and explains how to set up a demo system using the included CSS and templates.
The document discusses how to use Cascading Style Sheets (CSS) with Corvid Servlet Runtime templates to control formatting and layout. CSS allows separating design from content, making templates simpler and easier to maintain. It also enables customization of appearance for different devices. The document provides examples of how to apply CSS classes and rules to Corvid template elements to control fonts, colors, positioning and more.
The document provides an introduction to CSS and how it works with HTML to control the presentation and styling of web page content. It explains basic CSS concepts like selectors, properties and values, and how CSS rules are used to target specific HTML elements and style them. Examples are given of common CSS properties and selectors and how they can be used to style elements and format the layout of web pages.
Cascading Style Sheets (CSS) allow users to define how HTML elements are presented on a page. CSS enables changing the appearance and layout of an entire website by editing just one CSS file. CSS uses selectors to apply styles to HTML elements via properties and values. Styles can be defined internally in HTML or externally in CSS files. CSS can control text formatting, colors, spacing, positioning and more to achieve visual consistency across web pages.
Cascading Style Sheets (CSS) allow users to define how HTML elements are presented on a page. CSS enables changing the appearance and layout of an entire website by editing just one CSS file. CSS uses selectors to apply styles to HTML elements via properties and values. Styles can be defined internally in HTML or externally in CSS files. CSS can control text formatting, colors, spacing, positioning and more to achieve visual consistency across web pages.
This document provides instructions on using JavaScript to allow website visitors to select different cascading style sheets (CSS) and have their preference remembered via cookies. It discusses linking different types of style sheets, detecting browsers and objects, creating and reading cookies, and programming functions to get the current active style sheet and toggle between them when pages load and unload. Code snippets are provided to implement these functions to enable style sheet selection and remember the user's preference on future page visits.
This document provides instructions on using JavaScript to allow website visitors to select different cascading style sheets (CSS) and have their preference remembered via cookies. It discusses linking different types of style sheets, detecting browsers and objects, creating and reading cookies, and programming functions to get the current active style sheet and toggle between them when pages load and unload. Code snippets are provided to implement these functions to enable style sheet selection and remember the user's preference on future page visits.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
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.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
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
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
tutorial7
1. Programming on the Web(CSC309F)
Tutorial 7: Perl
TA:Wael Abouelsaadat
WebSite: http://www.cs.toronto.edu/~wael
Office-Hour: Friday 12:00-1:00 (SF2110)
Email: wael@cs.toronto.edu
1
2. Introduction to Perl
Ø History of Perl!
Ø Initially developed by Larry Wall (English major student then!) in 1987.
Ø Modules continuously added since version 2.0
Ø Latest version is Perl 5.6.1
Ø Ported to 83 platforms.
Ø Most popular “scripting” language for server-side web development.
Ø Pros && Cons:
ü Powerful in manipulating textual data.
ü A very rich set of pattern-matching operations (used extensively in text-searching, NLP systems,…).
ü Rich set of functions (via Perl modules).
ü Allow you to get the job done very quickly (but not necessarily elegantly! ).
û No GUI library.
û Weird syntax (greatly reduces maintainability of Perl progra ms).
Í Perl is an interpreted language.
Í Unix influence (originally built as a replacement for shell scripts and awk).
Ø helloworld.pl
§ Source:
print ( “Hello to Perl World!” );
print “Hello to Perl World!”; # yes, no brackets!
§ Run it:
C:> perl helloworld.pl
Hello to Perl World!Hello to Perl World!
2
3. Perl – Data types
Ø Specifying Types and Containers:
§ Variables are not explicitly declared. Perl interpreter guesses the type from the way the variable is written.
$var - names a variable that holds a scalar data type (integer, floating point or string).
@var - names a variable that holds an array of scalars, or list.
%var - names a variable that holds an associative array of scalars.
&var - names a subroutine.
§ E.g.
#Defining a scalar
$Name = "Jack";
$Age = 10;
#Defining and handling an array
@Colors = ("Red","Pink","Yellow");
$FirstColor = $Colors[0];
print( $FirstColor ); # Outputs Red
$Colors[0] = "White";
print( $Colors[0] ); # Outputs White
$Colors[100] = “Blue”; # This is valid because Arrays in Perl are dynamic in size
print( $Colors[100] ); # Outputs Blue
print( $#Colors ); # Prints 100 which is the last index of the array. This is a unique variable
# defined by the perl interpreter to give you access to current size of array
# Defining and handling a hash table
%Address = ("Apartment" => 101,
"Street" => "Bloor",
"City" => "Toronto");
$streetName = $Address{"Street"};
print( $streetName ); # Outputs Bloor
$Address{"City"} = "Ottawa";
print( $Address{"City"} ); # Outputs Ottawa
delete $Address{"City"};
@tkeys = keys(%Address); # keys function returns an array of the keys in the hash table
Ø Global vs. Local variables: 3
§ $Name = “John”; # Visible in the whole program
my $Name = “John”; # Visible in the block it is declared in
4. Perl – Strings
Ø Strings:
§ Difference between using the single quote (') and the double quote (") to delimit strings:
$Client = 'John Luu';
@Items = ( "Chocolate", "Biscuits", "Milk");
$Total = 60;
$Transaction = "$Client is buying @Items for $ $Total";
print( $Transaction ); # Outputs John Luu is buy ing Chocolate Biscuits Milk for $ 60
§ Concatenating Strings:
$FirstName = ‘John'; $LastName = “Black”;
$FullName = $First Name . $LastName ; # FullName is now “John Black”
§ String operators:
# lt: less than , le: less or equal , eq: equal , ge: greater or equal , ne: not equal , eq: equal
$Val1 = ‘1.1’; $Val2 = ‘1.0’;
$Val3 = ‘bbb’; $Val4 = ‘aaa’;
if( ($Val1 gt $Val2) && ($Val3 lt $Val4 ) ) ……………………
§ Pattern matching:
# =~: does match , !~: does not match
$CatString = “tomcat”
if ( $CatString =~ /cat/ ) …. # Right-hand-side of these operators must always be a regular expression
4
5. Perl – Control , Loops and Functions
ØControl statements:
§ If statement: Unless Statement
if( $Size < 10.0 ) { unless( $Name eq “John Black” ){
print( "Length is too small!n" ); print( “ You are not John Black” );
} }
elsif ( $Size > 100.0 ) {
print( "Length is too big!n" );
}
else{
print( "Length is just right!n" );
}
Ø Looping:
§ While Loops: For Loops:
while( $n <= 10 ) { for( $n = 1; $n <= 10; ++$n ) {
printf( "%d squared is %dn", $n, $n*$n ); printf( "%d squared is %dn", $n, $n*$n );
$n = $n + 1; }
}
§ For-each Loops:
@Digits = (0,1,2,3,4,5,6,7,8,9);
foreach $n (@Digits) {
printf( "%d squared is %dn", $n, $n*$n );
}
Ø Functions
§ e.g.:
sub func1{
my($param1,$param2) = @_; # parameters are passed in an array called @_
print "Inside func";
$param1 * $param2; # same as return($param1 * $param2 );
}
print(" Before calling func1");
$result = func1( 10,20 ); 5
print(" After calling func1");
print(" result : $result"); # prints result: 200
6. Perl – Functions cont’d
Ø Perl built-in functions:
§ Debugging Functions
# caller( )
# Unwinds the calling stack: ($package, $filename, $line,$SubName , $args,$$contentxt) = caller( $frame );
a( );
sub a { b(); }
sub b { c(); }
sub c { print ( “@{ [ caller(1) ] } “ ); } # Outputs main script.pl 2 main::b 1 0
# die( )
# Kills a process at a given point.
open ( REPORT_FILE, ">report.txt" ) || die " Error opening report.txt $! n " ;
# The above translates to if( open( ….) continue ) else { die …. }
# warn( )
# Does the same thing as die but does not exit.
§ Time Functions
# ($secs , $min, $hr, $mday, $mnth, $yr, $wd, $yd, $ds ) = localtime ( ); Gets local time
# ($user, $system, $child_user, $child_system ) = times( ); Benchmark code
# sleep( $seconds );
§ Variable Functions
# sort(…) Sorts an array in alphabetical order, or by a user-defined function.
@DestArray = ( ‘Apples’, ‘Bananas’, ‘Carrots’ );
@NewArray = sort( @DestArray ); #Be carefull with arrays of numbers
# split(…) Takes a scalar and separates it based on on the criteria us er provides
# @NewArray = split( $text, $ScalarName ); $text can be delimiter or regular expression
@splitArray = spli( “,” , $scalarName );
# grep(…) Finds which element in an array satisfies a condition.
#@NewArray = grep( EXPRESSION , @arrayToMatch );
@Foods = ( ‘turkey’, ‘lucky charms ’, ‘oranges’ ); 6
@longFoods = grep( length($_) > 6 , @foods );
7. Perl – Functions cont’d
# map(…) Makes a new array based on a transform from the old array.
# @NewArray = map( &function, @source_array );
@NewArray = map( MyFunc ( $_ ) , @SourceArray );
§ File Functions
# $bytes = read( FILEHANDLE, $scalar, $length, $offset )
Open( FILEHANDLE, “file” );
$bytes = read( FILEHANDLE, $input, 40, 20 ); # reads 40 characters from file into $input starting at 20
#printf [FILEHANDLE] $format_string, @arrayOfValues;
use FileHandle;
my $Fhandle = new FileHandle( “> my_file” );
$longvarb = “This has 23 chars in it”;
printf $Fhandle “%10.10sn” , $longvarb;
§String Functions
#chop( ) Deletes the last character in a scalar. If applied to Array, hash => does the same!
$line = “ Please chop the letter T”;
chop( $line );
# chomp( ) Deletes the new line character, at the end of the line, if exists.
# More funs: chr, crypt, hex, index, lc, length, oct, ord, pack, reverse, rindex, sprintf, substr, uc, ucfirst
§ Array Functions
#pop, push, shift, splice, unshift
§ Hash Functions
# delete, each, exists, keys, values
§ I/O Functions
# binmode , close, closedir, dbmclose, dbmopen, eof, fileno, flock, format, getc, print, printf, read, readdir,
# rewinddir, seek, seekdir, select, syscall, sysread, sysseek, syswrite, tell, telldir, truncate, write
§ Files/Directories Functions
# -X, chdir, chmod, chown, chroot, fcntl, glob, ioctl, link, lstat, mkdir, open, opendir, readlink, rename,
# rmdir, stat, symlink, umask, unlink, utime
7
8. Perl – Input and Output
Ø Printing Output:
§ Standard Output:
print( STDOUT "Hello World!n" );
print( "Hello World! n" );
§ Files:
open( OUT, ">test.dat" ); # Associates file handle with file
print( OUT “ This text will be written in the file " );
ØReading input:
§ Standard Output:
$NewLine = <STDIN>; # Reads one complete line from standard input
$ProgramArguments = <ARGV>; # Refer to arguments on the command line.
# e.g. perl prog param1 param2 param3
§ Files:
open( IN, “<test.dat" ); # Associates file handle with file
$Line = <IN>; # Reads the first line
close( IN );
8
9. Perl – Program Structure
Ø Perl Files (.pl) vs Perl Modules (.pm)
File.pl File.pm
§ Where is main()?
ØRequire Statement func1
§ Causes the Perl interpreter to “execute” the code in the require d file!
# foo.pl
func2
perl code
more perl code….
some code
1;
#-----------------------------------------------
# Poo.pl
require “foo.pl”;
perl code # you can call functions in foo.pl
Ø Defining a Perl package and the use statement
§ Semi-Object Oriented Programming! Creates a namespace.
# Student.pm
#!/usr/sbin/perl
package Student;
sub new {
# Initialization code
}
sub printDetails{
# perl code …..
}
#-------------------------------
# foo.pl
use Student; # Like inc lude in C++
$new_student = new Student( );
$new_student->printDetails( );
Ø Another way to use use !
Use CGI qw(); # Uses a specific function in a module: qw 9
Ø use strict;
§ Forces Perl interpreter to be strict in using types. Will save you a lot of time !
11. Perl - cgi.pm
Ø Using cgi.pm
use strict;
use CGI qw(:standard);
print ( header( ) );
print( start_html( “Anna Web Page” ) ); # <html><head><title>Anna Web Page</title></head><body>
print( table( ….) );
print( a(…) ); # <a href=“”> xyz </a>
print( radio_group(…..) );
print( end_html( ) ); # </body></html>
11
12. Assignment 3
Ø What is it about? Client(Web-Browser) Server(HTTP Server)
HTML/ Perl/
Ø What can you do right now? JavaScript/ CGI/
§ HTML (design and layout of the web pages) Cookies Cookies
§ JavaScript (validations)
SMTP POP3
Ø What you need to learn?
§ Perl
§ Cookies
§ CGI SMTP Server POP3 Server
12