Revue de parcours des pièges les plus classiques en PHP, entre les références qui pendouillent, les opérateurs et leur précédence, array_merge() en boucle, ou encore les fonctionnalités natives oubliées et les améliorations de PHP 8.0.
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us?
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert: code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too? Let's make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you're not frightening us!
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them.
Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
Conheça um pouco mais sobre Perl 6, uma linguagem de programação moderna, poderosa e robusta que permitirá que você escreva código de forma ágil e eficiente.
This document provides an introduction to PHP, covering its history, core concepts like variables, arrays, operators, control structures, and how to include external files. PHP is a server-side scripting language commonly used for web development. It was created in 1994 and has evolved through several versions. Key points covered include PHP's loose typing, how variables work and are assigned, the various operators available, using arrays to store multiple values, and control structures like if/else statements and loops to control program flow. The document also discusses including other files to reuse code and read external data files.
The document discusses Perl 6 types and type checking. It shows examples of declaring scalar, array and hash variables with implicit and explicit types like Any, Int and Str. It then demonstrates type checking failures when assigning values of the wrong type. It also covers defining custom types through subtypes and multi dispatch to handle different types.
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us?
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert: code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too? Let's make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you're not frightening us!
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them.
Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
Conheça um pouco mais sobre Perl 6, uma linguagem de programação moderna, poderosa e robusta que permitirá que você escreva código de forma ágil e eficiente.
This document provides an introduction to PHP, covering its history, core concepts like variables, arrays, operators, control structures, and how to include external files. PHP is a server-side scripting language commonly used for web development. It was created in 1994 and has evolved through several versions. Key points covered include PHP's loose typing, how variables work and are assigned, the various operators available, using arrays to store multiple values, and control structures like if/else statements and loops to control program flow. The document also discusses including other files to reuse code and read external data files.
The document discusses Perl 6 types and type checking. It shows examples of declaring scalar, array and hash variables with implicit and explicit types like Any, Int and Str. It then demonstrates type checking failures when assigning values of the wrong type. It also covers defining custom types through subtypes and multi dispatch to handle different types.
There are a lot of operators in Perl 6, so many that it can be called an OOL: operator oriented language. Here I describe most of them from the angle of contexts, which Perl 6 has also much more than Perl 5.
This document discusses growing and maintaining a healthy Perl community. It emphasizes making contributions easy, having a code of conduct, focusing on positivity, and being open and inclusive to encourage participation from new members and engagement across different languages and problem domains. Celebrating open source software and behaving like a member of the community you want to belong to are seen as important principles.
Climbing the Abstract Syntax Tree (PHP South Africa 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code. (*actual magic or time-warp not guaranteed)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)James Titcumb
Security is an enormous topic, and it’s really, really complicated. If you’re not careful, you’ll find yourself vulnerable to any number of attacks which you definitely don’t want to be on the receiving end of. This talk will give you just a taster of the vast array of things there is to know about security in modern web applications, such as writing secure PHP web applications and securing a Linux server. Whether you are writing anything beyond a basic brochure website, or even developing a complicated business web application, this talk will give you insights to some of the things you need to be aware of.
This document provides an introduction and outline for a Python fundamentals course focused on basic Python programming. The outline covers topics like introduction, data types, operators, flow control, functions, classes, exceptions, and file input/output. Code examples are provided for common concepts like Hello World, variables, conditionals, loops, functions, and classes. The goal is to teach Python basics to beginners.
Representing Material Culture Online: Historic Clothing in OmekaArden Kirkland
In June 2014 I was invited to present at the New York City Digital Humanities (NYCDH) Omeka User’s Group Workshop at the Bard Graduate Center. I spoke about my work with two different collections of historic clothing that are using Omeka as their platform, and shared some of the challenges of representing material culture online. This includes some details of the nuts and bolts behind each project, including samples of customized PHP for showing related items.
This builds on the presentation I gave at the annual symposium for the Costume Society of America, "One of Many Small Collections."
This document introduces Gutscript, a new programming language designed for PHP developers that aims to address perceived issues with PHP syntax and semantics. Gutscript code compiles to PHP, allowing reuse of existing PHP libraries. It uses a simpler, more concise syntax inspired by languages like Ruby and Perl. The document provides examples comparing Gutscript and PHP code, demonstrating how Gutscript addresses issues like verbose function definitions, complex namespaces, and inconsistent syntax. It also discusses the Go-based implementation and opportunities for optimization of compiled Gutscript code.
PHP 7.1 contains new exciting features and improvements that can facilitate the life of many PHP developers. During the talk I will show some of these new features like nullable types, catching of multiple exceptions, the curl HTTP/2 server push support, void return types, Class constant visibility, authenticated encryption in OpenSSL with GCM and CCM modes, and more.
Inside a Digital Collection: Historic Clothing in OmekaArden Kirkland
In July of 2014, I was invited to present a guest lecture for Foundations of Digital Data (IST676) at the Syracuse University School of Information Studies, taught by Angela U. Ramnarine-Rieks. This talk provides an inside look at creating a digital collection. As this was an online, asynchronous class, I recorded my presentation as a YouTube video, which you can see at http://youtu.be/vYTggDBqBgQ. It includes some discussion of the technical underpinnings of the Omeka site I've created for Vassar's collection of historic clothing, including slides that show my customizations in PHP for showing related items.
Perl provides many powerful features and modules that allow developers to customize and extend the language. Some popular modules include Moose for object-oriented programming, TryCatch for exception handling inspired by Perl 6, and P5.10 features that backport Perl 6 functionality. While useful, some features like autoboxing and state variables could introduce subtle bugs if misused. Overall, Perl's extensibility makes it a very flexible language that can be adapted to many different use cases.
This document provides an introduction and overview of PHP and MySQL for beginners. It discusses:
- What PHP is and how it is used to generate dynamic web pages by embedding PHP scripts in HTML.
- Key PHP concepts like variables, data types, echo, comments, functions, and control structures like if/else statements.
- How to connect to and query MySQL databases from PHP scripts using functions like mysql_connect().
- Additional PHP features like forms, sessions, includes and how to avoid common errors when using sessions.
The tutorial is intended to provide just enough PHP and MySQL knowledge to get started developing basic dynamic web applications that interface with databases.
This document discusses how Vim can improve productivity for Perl coding. It provides examples of using Vim motions and modes like Normal mode, Insert mode, and Visual mode to efficiently edit code. It also covers Vim features like syntax highlighting, custom syntax files, key mappings, and text objects that are useful for Perl. The document advocates that Vim is a powerful editor rather than an IDE and highlights how it can save significant time compared to less efficient editing methods.
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 describes the initialization of a graphical user interface (GUI) for a harmonicograph application using the Wx::Perl toolkit. It loads localization text, remembered favorites, and default parameter ranges. It then creates widgets like sliders, buttons and a drawing board and arranges them in a tabbed layout within a main frame window. The frame is populated with the widgets and initialized parameter values before being displayed.
This document discusses randomization functions in PHP like shuffle() and str_shuffle(). It examines how the implementations have changed over time in PHP versions. Specifically, it finds that earlier versions of shuffle() and str_shuffle() did not produce truly random results due to issues with the random number generation. The current implementations in recent PHP versions do properly randomize the values, but the document proposes reimplementing shuffle() to use mt_rand() for improved consistency across environments.
This document provides examples and explanations of various PHP functions for working with strings, numbers, and other data types. It includes functions for string manipulation like substr(), str_replace(), strpos(), explode(), and implode(). Numeric functions demonstrated include type checking, conversion between binary, octal, hexadecimal and decimal numbers. Other functions covered are trim(), list(), printf()/sprintf() for formatting output, and math functions like floor(), ceil() and round(). Examples are given for each function to illustrate its usage.
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Many people doesn't know about passwords stored in database...
What's the right and safe way to do?
OK! In this short presentation teaches about this.
The pgcrypto extension provides functions to ease hashing and salting passwords.
A Python script was used as example.
This document provides tips, tricks, and examples of common gotchas in PHP programming. It demonstrates unexpected behaviors that can occur due to PHP's highly dynamic nature and weakly typed system. A series of code snippets are shown with their expected versus actual outputs to illustrate issues one may encounter with variables, strings, arrays, and type coercion. The document also provides best practices for PHP development and an overview of common topics covered in the PHP certification exam.
This document contains sample questions for the Zend Certification PHP 5 exam. It includes multiple choice questions testing PHP 5 language features and best practices related to topics like XML processing, database access, regular expressions, and security. The questions cover syntax, functions, patterns and other PHP concepts that could appear on the certification exam.
There are a lot of operators in Perl 6, so many that it can be called an OOL: operator oriented language. Here I describe most of them from the angle of contexts, which Perl 6 has also much more than Perl 5.
This document discusses growing and maintaining a healthy Perl community. It emphasizes making contributions easy, having a code of conduct, focusing on positivity, and being open and inclusive to encourage participation from new members and engagement across different languages and problem domains. Celebrating open source software and behaving like a member of the community you want to belong to are seen as important principles.
Climbing the Abstract Syntax Tree (PHP South Africa 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code. (*actual magic or time-warp not guaranteed)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)James Titcumb
Security is an enormous topic, and it’s really, really complicated. If you’re not careful, you’ll find yourself vulnerable to any number of attacks which you definitely don’t want to be on the receiving end of. This talk will give you just a taster of the vast array of things there is to know about security in modern web applications, such as writing secure PHP web applications and securing a Linux server. Whether you are writing anything beyond a basic brochure website, or even developing a complicated business web application, this talk will give you insights to some of the things you need to be aware of.
This document provides an introduction and outline for a Python fundamentals course focused on basic Python programming. The outline covers topics like introduction, data types, operators, flow control, functions, classes, exceptions, and file input/output. Code examples are provided for common concepts like Hello World, variables, conditionals, loops, functions, and classes. The goal is to teach Python basics to beginners.
Representing Material Culture Online: Historic Clothing in OmekaArden Kirkland
In June 2014 I was invited to present at the New York City Digital Humanities (NYCDH) Omeka User’s Group Workshop at the Bard Graduate Center. I spoke about my work with two different collections of historic clothing that are using Omeka as their platform, and shared some of the challenges of representing material culture online. This includes some details of the nuts and bolts behind each project, including samples of customized PHP for showing related items.
This builds on the presentation I gave at the annual symposium for the Costume Society of America, "One of Many Small Collections."
This document introduces Gutscript, a new programming language designed for PHP developers that aims to address perceived issues with PHP syntax and semantics. Gutscript code compiles to PHP, allowing reuse of existing PHP libraries. It uses a simpler, more concise syntax inspired by languages like Ruby and Perl. The document provides examples comparing Gutscript and PHP code, demonstrating how Gutscript addresses issues like verbose function definitions, complex namespaces, and inconsistent syntax. It also discusses the Go-based implementation and opportunities for optimization of compiled Gutscript code.
PHP 7.1 contains new exciting features and improvements that can facilitate the life of many PHP developers. During the talk I will show some of these new features like nullable types, catching of multiple exceptions, the curl HTTP/2 server push support, void return types, Class constant visibility, authenticated encryption in OpenSSL with GCM and CCM modes, and more.
Inside a Digital Collection: Historic Clothing in OmekaArden Kirkland
In July of 2014, I was invited to present a guest lecture for Foundations of Digital Data (IST676) at the Syracuse University School of Information Studies, taught by Angela U. Ramnarine-Rieks. This talk provides an inside look at creating a digital collection. As this was an online, asynchronous class, I recorded my presentation as a YouTube video, which you can see at http://youtu.be/vYTggDBqBgQ. It includes some discussion of the technical underpinnings of the Omeka site I've created for Vassar's collection of historic clothing, including slides that show my customizations in PHP for showing related items.
Perl provides many powerful features and modules that allow developers to customize and extend the language. Some popular modules include Moose for object-oriented programming, TryCatch for exception handling inspired by Perl 6, and P5.10 features that backport Perl 6 functionality. While useful, some features like autoboxing and state variables could introduce subtle bugs if misused. Overall, Perl's extensibility makes it a very flexible language that can be adapted to many different use cases.
This document provides an introduction and overview of PHP and MySQL for beginners. It discusses:
- What PHP is and how it is used to generate dynamic web pages by embedding PHP scripts in HTML.
- Key PHP concepts like variables, data types, echo, comments, functions, and control structures like if/else statements.
- How to connect to and query MySQL databases from PHP scripts using functions like mysql_connect().
- Additional PHP features like forms, sessions, includes and how to avoid common errors when using sessions.
The tutorial is intended to provide just enough PHP and MySQL knowledge to get started developing basic dynamic web applications that interface with databases.
This document discusses how Vim can improve productivity for Perl coding. It provides examples of using Vim motions and modes like Normal mode, Insert mode, and Visual mode to efficiently edit code. It also covers Vim features like syntax highlighting, custom syntax files, key mappings, and text objects that are useful for Perl. The document advocates that Vim is a powerful editor rather than an IDE and highlights how it can save significant time compared to less efficient editing methods.
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 describes the initialization of a graphical user interface (GUI) for a harmonicograph application using the Wx::Perl toolkit. It loads localization text, remembered favorites, and default parameter ranges. It then creates widgets like sliders, buttons and a drawing board and arranges them in a tabbed layout within a main frame window. The frame is populated with the widgets and initialized parameter values before being displayed.
This document discusses randomization functions in PHP like shuffle() and str_shuffle(). It examines how the implementations have changed over time in PHP versions. Specifically, it finds that earlier versions of shuffle() and str_shuffle() did not produce truly random results due to issues with the random number generation. The current implementations in recent PHP versions do properly randomize the values, but the document proposes reimplementing shuffle() to use mt_rand() for improved consistency across environments.
This document provides examples and explanations of various PHP functions for working with strings, numbers, and other data types. It includes functions for string manipulation like substr(), str_replace(), strpos(), explode(), and implode(). Numeric functions demonstrated include type checking, conversion between binary, octal, hexadecimal and decimal numbers. Other functions covered are trim(), list(), printf()/sprintf() for formatting output, and math functions like floor(), ceil() and round(). Examples are given for each function to illustrate its usage.
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Many people doesn't know about passwords stored in database...
What's the right and safe way to do?
OK! In this short presentation teaches about this.
The pgcrypto extension provides functions to ease hashing and salting passwords.
A Python script was used as example.
This document provides tips, tricks, and examples of common gotchas in PHP programming. It demonstrates unexpected behaviors that can occur due to PHP's highly dynamic nature and weakly typed system. A series of code snippets are shown with their expected versus actual outputs to illustrate issues one may encounter with variables, strings, arrays, and type coercion. The document also provides best practices for PHP development and an overview of common topics covered in the PHP certification exam.
This document contains sample questions for the Zend Certification PHP 5 exam. It includes multiple choice questions testing PHP 5 language features and best practices related to topics like XML processing, database access, regular expressions, and security. The questions cover syntax, functions, patterns and other PHP concepts that could appear on the certification exam.
[PL] Jak nie zostać "programistą" PHP?Radek Benkel
Po sieci krąży wiele opinii, jak to programiści PHP nie są prawdziwymi programistami i że PHP to w ogóle nie jest język programowania, etc.
A winni takiego stanu rzeczy są sami programiści bądź właśnie „programiści”. Dlaczego? W każdym języku da się napisać kod zły jak i dobry. A w świecie PHP niestety dużo jest tego złego – choć trend ten zmienia się na lepsze.
Celem wykładu jest zapoznanie uczestników z rzeczami, na które należy zwrócić uwagę podczas tworzenia aplikacji w języku PHP. Druga (krótsza) część prezentacji będzie poświęcona ogólnym dobrym praktykom programistycznym, nie związanym z żadnym konkretnym językiem.
The document discusses PHP arrays. It explains how to create, access, and modify array elements using indexes. It also covers common array functions like count(), print_r(), sort(), and more. Examples are provided to demonstrate appending, popping, pushing, and other operations on arrays. The document also discusses multidimensional arrays and using foreach loops to iterate over arrays.
The document discusses PHP arrays. It explains how to create, access, and modify array elements using indexes. It also covers common array functions like count(), print_r(), sort(), and more. Examples are provided to demonstrate appending, popping, pushing, and other operations on arrays. The document also discusses multidimensional arrays and using foreach loops to iterate over arrays.
This document summarizes the history and future of PHP. It discusses the creators of PHP (Rasmus Lerdorf, Zeev Suraski, John Morris) and outlines the major versions released from PHP 1.0 in 1995 to the upcoming PHP 8.0, which will include features like FFI, JIT compilation, and asynchronous programming. It also previews potential features for future PHP versions such as OpCache core improvements and extending the instanceof operator.
Even nowadays, PHP code is mostly manually audited. Expert pore over actual code, in search for bugs or code smells. Actually, it is possible to have PHP do this work itself ! Strengthened with the internal Tokenizer, bolstered by the manual, it is able to scan thousands of lines of code, without getting bored, and bringing pragmatic pieces of wisdom: official manual recommendations, version migration, code pruning and security. In the end, it deliver a global overview of the code, without reading it.
The document discusses PHP arrays. It explains that arrays allow storing multiple values in a single variable and accessing them via indexes. Various array functions are described like count(), print_r(), sort(), array_pop(), which can be used to manipulate array elements. Examples show how to iterate through arrays using for loops and foreach loops. Multidimensional arrays are also covered.
The document discusses PHP arrays. It explains that arrays allow storing multiple values in a single variable and accessing them via indexes. Various array functions are described like count(), print_r(), sort(), array_pop(), which can be used to manipulate array elements. Examples show how to iterate through arrays using for loops and foreach loops. Multidimensional arrays are also covered with examples to store and access nested array elements.
This document discusses ways to prevent malicious Perl code from executing harmful actions by overriding core functions like die() and system() as well as by faking module imports. It explores how the Acme::BadExample module tries to perform dangerous tasks and ways Anti::Code can intervene to stop it without errors.
Even nowadays, PHP code is mostly manually audited. Expert pore over actual code, in search for bugs or code smells. Actually, it is possible to have PHP do this work itself ! Strengthened with the internal Tokenizer, bolstered by the manual, it is able to scan thousands of lines of code, without getting bored, and bringing pragmatic pieces of wisdom: official manual recommendations, version migration, code pruning and security. In the end, it deliver a global overview of the code, without reading it.
This document provides an introduction and overview of PHP, including what PHP is, what is needed to use it, basic syntax, variables, data types, operators, control structures like if/else and loops, functions, and includes/requires. Key points covered include PHP being a server-side scripting language, basic syntax using <?php ?> tags, common variable types and scoping, operators for arithmetic, comparison and logic, and common control structures for conditional execution and repetition.
The document provides an introduction to PHP including what PHP is, the basic syntax, variable types, operators, control structures like if/else and loops, and functions. PHP is a server-side scripting language used for web development that is embedded into HTML. It requires a web server with PHP enabled and uses <?php ?> tags. The document outlines the basic building blocks of PHP like variables, data types, operators, and control flow structures.
Ruby is amazing. It has a huge standard library and a core choc full of weird and wonderful things. In this talk, given at the Ipswich Ruby User Group, I give a whimsical nonstop tour through some of the more obscure parts of Ruby.
The document discusses strategies for writing friendly libraries in CodeIgniter, including making libraries testable, reducing coupling, versioning, documentation, adaptability, and namespacing. It also provides tips for writing libraries such as using configuration, helpers, language files, and not restricting yourself.
Making JavaScript Libraries More ApproachablePamela Fox
A talk given at NotConf in Phoenix, Texas in 2012.
(Alternative title: Why nested ternary operators make me want to kick inanimate objects in the nuts.)
The document provides an overview of modern Perl features including:
- Using say() instead of print for output
- Defined-or operator //
- switch/given statement for conditionals
- Smart matching with ~~ operator
- state keyword for static variables
- New regex features like named capture buffers
- Object oriented programming with Moose
- Defining classes, attributes, types and inheritance with Moose
- Exception handling with TryCatch and autodie
- Best practices for coding style, layout, testing and more
Dealing with Legacy Perl Code - Peter ScottO'Reilly Media
The document discusses best practices for maintaining Perl code while avoiding burnout. It provides tips on dealing with legacy Perl code, avoiding common myths, testing code, improving code layout and readability, analyzing code for improvements, and handling inherited code. Key recommendations include adopting best practices, writing tests, using tools like perltidy and Devel modules, improving documentation, and refactoring code for clarity and maintainability.
The document discusses various PHP programming concepts including conditional statements like if/else, switch statements, arrays, loops, functions, and nested looping. It provides code examples to demonstrate how to use if/elseif/else statements, foreach and for loops, functions with and without parameters/return values, and nested looping to create a multiplication table. It also covers break and continue statements and using cellpadding and cellspacing in HTML tables.
There are tactical reasons to adopt strong typehint: easy validation, less code, fashionable. Besides, the first typehints blend in effortlessly with the current application: it is as if typehint was already there. Later, it appears that scalar types paved the way to more substantial code refactoring. Classes emerge from the initial scalar types, code congregate around important values, types gets more complex. Finally, systemic typehint arrives. Type hints become systemic when they help tame the class dependency hell, and help us plan for the new code. During the session, we'll cover the various stages of using typehints, with their advantages, and when not to overuse them.
Strong typing : adoption, adaptation and organisationDamien Seguy
There are tactical reasons to adopt strong typehint: easy validation, less code, fashionable. Besides, the first typehints blend in effortlessly with the current application: it is as if typehint was already there. Later, it appears that scalar types paved the way to more substantial code refactoring. Classes emerge from the initial scalar types, code congregate around important values, types gets more complex. Finally, systemic typehint arrives. Type hints become systemic when they help tame the class dependency hell, and help us plan for the new code. During the session, we’ll cover the various stages of using typehints, with their advantages, and when not to overuse them.
Qui a laissé son mot de passe dans le codeDamien Seguy
Qui, de nos jours, laisse encore son mot de passe dans le code? Pour quelles raisons? Et comment éviter de voir ses secrets atterrir en production, ou dans un dépot public? en utilisant Exakat et git-secrets.
Présentation en détail de l'analyse statique : ses fondements en PHP, ses mécanismes internes, les processus d'augmentation des connaissances et de personnalisation des analyses, ainsi que les résultats d'audits.
Meilleur du typage fort (AFUP Day, 2020)Damien Seguy
Le typage se propage à tout PHP : la 7.4 l’ajoute aux propriétés, après les arguments et les valeurs de retours. Bien qu’opposé aux choix initiaux de typage faible de PHP, le typage augmente significativement la cohérence du code, son niveau d’auto-validation et les possibilités de dépendances inextricables. Le typage contribue à aider les outils d’introspection, à débuguer le code au plus tôt, et à adopter des techniques de développement comme le motif de l’objet null. C’est un outil supplémentaire, pratique pour les grands projets, et facilement déployé.
https://event.afup.org/afup-day-2020/afup-day-2020-tours/programme/#3246
Déjà, PHP 7.4 toque à la porte, et il arrive les bras chargés de fonctionnalités et de modernisations. Que ce soit les FFI, le support du typage pour les propriétés, l’abandon des nombres real, la covariance, et même la modernisation de strip_tags, array_merge sans argument, et l’imbrication d’opérateurs ternaires : ouf, il va falloir se retrousser les manches. Durant la session, nous passerons en revue les nouvelles fonctionnalités, les incompatibilités, et nous verrons comment préparer son code dès maintenant.
PHP a son lot de surprises qui pimente notre vie de développeur : le code qui meurt d’un coup de namespace, strpos qui ne trouve pas sa chaîne et les tableaux qui se modifient sans qu’on y touche. Ca vous énerve vous aussi ? Alors, en 20 minutes, on va dresser un florilège des erreurs les plus vicieuses, comment les corriger et comment les garder loin de votre code. Attachez vos ceintures !
Static analysis is an emerging field, in particular in the PHP world. Reviewing source code at the speed of a computer requires powerful theoretical tools: control flow diagram, abstract syntactic trees, acyclic dependency graph.
If all this seems far and remote from PHP, come and learn how they apply to your favorite language! They are all useful when it comes to detecting early those errors that end up in production, and sometimes, even before the code may compile. We’ll see how to combine all those aspects to build a useful auditing engine.
Static analysis for PHP Static analysis is an emerging field, in particular in the PHP world. Reviewing source code at the speed of a computer requires powerful theoretical tools: control flow diagram, abstract syntactic trees, acyclic dependency graph. If all this seems far and remote from PHP, come and learn how they apply to your favorite language! We'll see how to combine all those aspects to build a useful auditing engine.
Review unknown code with static analysis php ce 2018Damien Seguy
Code quality is not just for christmas, it is a daily part of the job. So, what do you do when you're handed with a five feet long pole a million lines of code that must be vetted ? You call static analysis to the rescue. During one hour, we'll be reviewing totally unknown code code : no name, no usage, not a clue. We'll apply a wide range of tools, reaching for anything that helps us understand the code and form an opinion on it. Can we break this mystery and learn how everyone else is looking at our code ?
PHP 7.3 is already bet3 and we will get the final version shortly after Sinterklaas.
A wide range of new features are already available for testing, including the relaxed syntax for Heredocs, the final comma in function calls, and a crowd of smaller increments.
We’ll review those evolutions, check the incompatibilities, and try to find the in PHP code.
Finally, we’ll present the RFC process that leads to new features : we can start to discover PHP 7.4 together!
PHP 7.3 sera en beta à la fin de l'été, et cible une sortie avant Noel. De nombreuses nouveautés sont prévues de longue date, comme l'évolution de la syntaxe heredoc, ou les , finales pour les appels de fonctions, tandis qu'une rafale de nouveautés se bousculent au portillon, et ont même généré une alpha 4. Nous passerons en revue toutes ces évolutions, ainsi que les incompatibilités, comment les trouver dans du code, et comment fonctionnent les RFC de PHP.
PHP 7.3 sera en beta à la fin de l'été, et cible une sortie avant Noel. De nombreuses nouveautés sont prévues de longue date, comme l'évolution de la syntaxe heredoc, ou les , finales pour les appels de fonctions, tandis qu'une rafale de nouveautés se bousculent au portillon, et ont même
généré une alpha 4. Nous passerons en revue toutes ces évolutions, ainsi que les incompatibilités, comment les trouver dans du code, et comment fonctionnent les RFC de PHP.
Review unknown code with static analysis php ipc 2018Damien Seguy
Code quality is not just for christmas, it is a daily part of the job. So, what do you do when you’re handed with a five feet long pole a million lines of code that must be vetted ? You call static analysis to the rescue. During one hour, we’ll be reviewing totally unknown code code : no name, no usage, not a clue. We’ll apply a wide range of tools, reaching for anything that helps us understand the code and form an opinion on it. Can we break this mystery and learn how everyone else is looking at our code ?
This document discusses tips for conducting quick and useful code reviews. It recommends including code reviews in your daily coding routine by dedicating short periods of time, such as 15 minutes, to focused code reviews. The document provides suggestions for what to review, such as choosing common bugs or static analysis rules to search for issues. It emphasizes fixing easy bugs first and using code reviews as an opportunity to learn new techniques and document local coding idioms.
Static analysis tools checks PHP code without running them. Fully automated, they bring expertise to review the code, enforce good practices when programming, keep code ready for the next PHP version. PHP 7 has developed tremendously our capacity to audit code. Thanks to AST and return types, it is possible to go deeper and prevent more bugs. During this session, we'll review the current state of static analysis tools, learn what they can find for us, and how to integrate it in the development cycle: security bugs, migration incompatibilities, and directives recommendations. Simply said, better PHP coding.
Machine learning for PHP
Machine learning is teaching the computer how to learn by itself. It is far easier to be done, especially when you have small data set and a good level of expertise in your field. Classifying objects, predicting who will buy, spotting comments in code is achieved with grassy algorithms like neural networks, genetic algorithms or ant herding. PHP is in good position to make use of such teachings, and take advantages of related technologies like fann. By the end of the session, you’ll know where you want to try it.
Review unknown code with static analysis Zend con 2017Damien Seguy
Code quality is not just for Christmas, it is a daily part of the job. So, what do you do when you're handed with a five feet long pole a million lines of code that must be vetted? You call static analysis to the rescue. During one hour, we'll be reviewing totally unknown code: no name, no usage, not a clue. We'll apply a wide range of tools, reaching for anything that helps us understand the code and form an opinion on it. Can we break this mystery and learn how everyone else is looking at our code?
Review unknown code with static analysisDamien Seguy
Review unknown code with static analysis
Code quality is not just for christmas, it is a daily part of the job. So, what do you do when you’re handed with a five feet long pole a million lines of code that must be vetted ? You call static analysis to the rescue. During one hour, we’ll be reviewing totally unknown code code : no name, no usage, not a clue. We’ll apply a wide range of tools, reaching for anything that helps us understand the code and form an opinion on it. Can we break this mystery and learn how everyone else is looking at our code ?
Static analysis tools checks PHP code without running them. Fully automated, they bring expertise to review the code, enforce good practices when programming, keep code ready for the next PHP version. PHP 7 has developed tremendously our capacity to audit code - thanks to AST and return types, it is possible to go deeper and prevent more bugs. During this session, we'll review the current state of static analysis tools, learn what they can find for us, and how to integrate it in the development cycle - security bugs, migration incompatibilities, directives recommendations. Simply said, better PHP coding.
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Ukraine
Під час доповіді відповімо на питання, навіщо потрібно підвищувати продуктивність аплікації і які є найефективніші способи для цього. А також поговоримо про те, що таке кеш, які його види бувають та, основне — як знайти performance bottleneck?
Відео та деталі заходу: https://bit.ly/45tILxj
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
Conversational agents, or chatbots, are increasingly used to access all sorts of services using natural language. While open-domain chatbots - like ChatGPT - can converse on any topic, task-oriented chatbots - the focus of this paper - are designed for specific tasks, like booking a flight, obtaining customer support, or setting an appointment. Like any other software, task-oriented chatbots need to be properly tested, usually by defining and executing test scenarios (i.e., sequences of user-chatbot interactions). However, there is currently a lack of methods to quantify the completeness and strength of such test scenarios, which can lead to low-quality tests, and hence to buggy chatbots.
To fill this gap, we propose adapting mutation testing (MuT) for task-oriented chatbots. To this end, we introduce a set of mutation operators that emulate faults in chatbot designs, an architecture that enables MuT on chatbots built using heterogeneous technologies, and a practical realisation as an Eclipse plugin. Moreover, we evaluate the applicability, effectiveness and efficiency of our approach on open-source chatbots, with promising results.
TrustArc Webinar - Your Guide for Smooth Cross-Border Data Transfers and Glob...TrustArc
Global data transfers can be tricky due to different regulations and individual protections in each country. Sharing data with vendors has become such a normal part of business operations that some may not even realize they’re conducting a cross-border data transfer!
The Global CBPR Forum launched the new Global Cross-Border Privacy Rules framework in May 2024 to ensure that privacy compliance and regulatory differences across participating jurisdictions do not block a business's ability to deliver its products and services worldwide.
To benefit consumers and businesses, Global CBPRs promote trust and accountability while moving toward a future where consumer privacy is honored and data can be transferred responsibly across borders.
This webinar will review:
- What is a data transfer and its related risks
- How to manage and mitigate your data transfer risks
- How do different data transfer mechanisms like the EU-US DPF and Global CBPR benefit your business globally
- Globally what are the cross-border data transfer regulations and guidelines
Session 1 - Intro to Robotic Process Automation.pdfUiPathCommunity
👉 Check out our full 'Africa Series - Automation Student Developers (EN)' page to register for the full program:
https://bit.ly/Automation_Student_Kickstart
In this session, we shall introduce you to the world of automation, the UiPath Platform, and guide you on how to install and setup UiPath Studio on your Windows PC.
📕 Detailed agenda:
What is RPA? Benefits of RPA?
RPA Applications
The UiPath End-to-End Automation Platform
UiPath Studio CE Installation and Setup
💻 Extra training through UiPath Academy:
Introduction to Automation
UiPath Business Automation Platform
Explore automation development with UiPath Studio
👉 Register here for our upcoming Session 2 on June 20: Introduction to UiPath Studio Fundamentals: https://community.uipath.com/events/details/uipath-lagos-presents-session-2-introduction-to-uipath-studio-fundamentals/
An All-Around Benchmark of the DBaaS MarketScyllaDB
The entire database market is moving towards Database-as-a-Service (DBaaS), resulting in a heterogeneous DBaaS landscape shaped by database vendors, cloud providers, and DBaaS brokers. This DBaaS landscape is rapidly evolving and the DBaaS products differ in their features but also their price and performance capabilities. In consequence, selecting the optimal DBaaS provider for the customer needs becomes a challenge, especially for performance-critical applications.
To enable an on-demand comparison of the DBaaS landscape we present the benchANT DBaaS Navigator, an open DBaaS comparison platform for management and deployment features, costs, and performance. The DBaaS Navigator is an open data platform that enables the comparison of over 20 DBaaS providers for the relational and NoSQL databases.
This talk will provide a brief overview of the benchmarked categories with a focus on the technical categories such as price/performance for NoSQL DBaaS and how ScyllaDB Cloud is performing.
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Keywords: AI, Containeres, Kubernetes, Cloud Native
Event Link: https://meine.doag.org/events/cloudland/2024/agenda/#agendaId.4211
QA or the Highway - Component Testing: Bridging the gap between frontend appl...zjhamm304
These are the slides for the presentation, "Component Testing: Bridging the gap between frontend applications" that was presented at QA or the Highway 2024 in Columbus, OH by Zachary Hamm.
MongoDB to ScyllaDB: Technical Comparison and the Path to SuccessScyllaDB
What can you expect when migrating from MongoDB to ScyllaDB? This session provides a jumpstart based on what we’ve learned from working with your peers across hundreds of use cases. Discover how ScyllaDB’s architecture, capabilities, and performance compares to MongoDB’s. Then, hear about your MongoDB to ScyllaDB migration options and practical strategies for success, including our top do’s and don’ts.
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsScyllaDB
ScyllaDB monitoring provides a lot of useful information. But sometimes it’s not easy to find the root of the problem if something is wrong or even estimate the remaining capacity by the load on the cluster. This talk shares our team's practical tips on: 1) How to find the root of the problem by metrics if ScyllaDB is slow 2) How to interpret the load and plan capacity for the future 3) Compaction strategies and how to choose the right one 4) Important metrics which aren’t available in the default monitoring setup.
This talk will cover ScyllaDB Architecture from the cluster-level view and zoom in on data distribution and internal node architecture. In the process, we will learn the secret sauce used to get ScyllaDB's high availability and superior performance. We will also touch on the upcoming changes to ScyllaDB architecture, moving to strongly consistent metadata and tablets.
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...Jason Yip
The typical problem in product engineering is not bad strategy, so much as “no strategy”. This leads to confusion, lack of motivation, and incoherent action. The next time you look for a strategy and find an empty space, instead of waiting for it to be filled, I will show you how to fill it in yourself. If you’re wrong, it forces a correction. If you’re right, it helps create focus. I’ll share how I’ve approached this in the past, both what works and lessons for what didn’t work so well.
Discover the Unseen: Tailored Recommendation of Unwatched ContentScyllaDB
The session shares how JioCinema approaches ""watch discounting."" This capability ensures that if a user watched a certain amount of a show/movie, the platform no longer recommends that particular content to the user. Flawless operation of this feature promotes the discover of new content, improving the overall user experience.
JioCinema is an Indian over-the-top media streaming service owned by Viacom18.
6. Le vrai visage de strpos()
<?php
// uniquement les comparaisons avec 0
if (strpos($string, 'a') === false) { }
// pas de zéro, pas de confusion
if (strpos($string, 'a') == 2) { }
// strpos() n'est pas le seul...
if (preg_match($regex, $string)) { }
🐘
17. Tous en même temps
<?php
$fp = fopen('php://memory', 'w+');
foreach($array as $row) {
fputcsv($fp, $row);
}
rewind($fp);
file_put_contents($file,
stream_get_contents($fp));
?>
🚀
54. La marque sans nom
<?php
preg_match('/(?<here>a)(b)?(.?)/', 'adc', $r);
preg_match("/(?'here'a)(b)?(.?)/", 'adc', $r);
/*
Array
(
[0] => ad
[here] => a
[1] => a
[2] =>
[3] => d
)
*/
🐘
55. La marque sans nom<?php
preg_match(
'/(?<here>a) # named subpattern
(b)? # optional b
(.?) # because Damien told us
/x', 'abc', $r);
print_r($r);
/*
Array
(
[0] => ad
[here] => a
[1] => a
[2] =>
[3] => d
)
*/
🐘