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.
This document summarizes the key topics that will be covered in an introduction to Perl programming course on day 2, including types of variables, references, sorting, and object orientation. The schedule outlines times for lectures, breaks and lunch. Resources provided include slides, slideshare, and an online community.
Perl 5.10 for People Who Aren't Totally InsaneRicardo Signes
The document discusses new features and changes in Perl 5.10. Some key points include:
- Perl 5.10 introduces many new features and changes that are not backwards compatible with Perl 5.8.x.
- Notable new features include lexically scoped pragmas, pluggable regular expression engines, smarter pattern matching, and state variables.
- The document provides examples of new operators and functions like smart matching (~~), given/when, and say that output a newline.
The document provides an overview of an introduction to Perl programming course. It covers topics that will be discussed including creating and running Perl programs, variables, operators, functions, input/output, and conditional statements. The schedule lists times for beginning sessions, breaks, and ending each day. Resources for slides and mailing lists are also provided.
Perl, a cross-platform, open-source computer programming language used widely in the commercial and private computing sectors. Perl is a favourite among Web developers for its flexible, continually evolving text-processing and problem-solving capabilities.
The document discusses improving the Dev Assistant project, an AI assistant tool, by reducing its use of PERL code and making it more accessible to non-expert Perl programmers. It encourages readers to contribute by forking the project's Github repository, making code changes, and submitting pull requests to help the project team modernize the codebase and provide a better first impression of the Perl language.
This document provides an overview and schedule for an introduction to Perl course. The key topics that will be covered include: what Perl is, creating and running Perl programs, Perl variables, operators and functions, conditional constructs, subroutines, regular expressions, finding and using modules. The schedule outlines breaks and lunch over the course of the day from 09:45 to 17:00. Resources for slides and further information are also listed.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
PHP is a server-side scripting language commonly used for web development. It allows creation of dynamic content and applications. Some key things PHP can do include building shopping carts, content management systems, forums, and other web applications. PHP code is processed on the server and the results are sent to the user's browser. Variables, arrays, and other data types can store and manipulate information. Control structures like if/else statements and loops allow conditional execution of code. Functions allow reusable blocks of code to be defined. Sessions allow storing of data across multiple pages for a user.
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.
Correctly understanding the eight data types in PHP is essential to a solid foundation in development. Come refresh your knowledge of the scalar types, compound types, and special data types used in PHP, and learn about proper usage of each. Review type juggling, learn some common data type traps to avoid, and how to code defensively to prevent having the data type of a variable change unexpectedly. Finally learn how unit tests can help verify that code is handling data types correctly.
The document outlines an intermediate Perl training course covering various Perl topics including:
- Types of variables (lexical and package)
- References and complex data structures
- Sorting techniques including custom sorting functions
- Creating reusable code through Perl modules and exporting subroutines
The schedule includes sessions on variables, references, sorting, modules and other topics with breaks for coffee and lunch.
There are several tools out there that help to develop and maintain high quality PHP code. They allow you to identify the most fragile and messy parts of your codebase. PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. Learn how it works, how you can use it and how can you bend it to meet your requirements!
This document provides an introduction to PHP. It covers a brief history of PHP and its syntax which is based on Perl, Java, and C. It also discusses parsing, variables, arrays, operators, control structures, and using external data files. Zend is discussed as the company that provides the Zend engine and other PHP products. Key PHP concepts covered include PHP scripts, including and requiring files, variable variables, and object oriented programming. The document is intended to give an overview of PHP for beginners.
The document provides an overview of PHP concepts including variables, data types, functions, and more. It discusses PHP syntax like tags and comments. Key points covered include:
- PHP is a scripting language widely used for web development and is free to use
- Variables store and manipulate data in PHP and have no predefined type
- PHP has several data types including integers, doubles, strings, arrays, and objects
- Functions define reusable blocks of code and can accept parameters
- echo and print output content, with echo being marginally faster
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 key concepts in PHP including objects, classes, functions, and global arrays. It provides examples of defining classes with public and private variables, using constructors, and accessing class variables from inside and outside methods. It also covers defining and calling functions, and the global arrays that PHP automatically creates to store environment, POST, GET, and other information.
This document provides an overview of regular expressions (regexes) and grammars in Perl 6. It discusses key concepts like rules, tokens, and capturing matches. Regexes allow matching patterns in strings, while grammars parse strings according to defined rules and tokens. The document gives examples of grammars for search queries and dates that capture city, country, from and to dates, and guest numbers. It demonstrates parsing strings and accessing captured values to retrieve individual fields.
The document discusses several topics related to using Perl for bioinformatics lessons including:
- Providing lesson materials and additional educational resources online
- Benefits of using web technology like having questions answered online and avoiding repetitive questions
- Practicum details like introductions, assignments, and locations
- An introduction to the Perl programming language including its history, uses, and advantages for bioinformatics tasks
- Examples of bioinformatics problems that can be solved using Perl like sequence analysis, parsing results, and database queries
This document consists of 19 lines repeatedly stating that images remain the property of the Black Dog Institute. It asserts copyright over any images without providing further relevant content.
OBJETIVO GENERAL
Crear una infraestructura que sirva como espacio que ayude al desarrollo integral de la comunidad donde estaría ubicado el proyecto y su ámbito de influencia.
The document discusses the purpose and use of the Texas Star Chart, which is a survey that assesses four key areas related to technology in teaching and learning. The Star Chart is designed to help teachers, campuses, and districts evaluate their progress on technology goals and identify professional development needs. It also assists with developing technology plans by helping conceptualize visions and set benchmarks. The summary provides timelines for survey distribution, completion, and reporting to aid campuses and districts in understanding where they are at on their technology implementation.
The market è una simulazione di compra-vendita in lingua inglese realizzato dalle classi quinte nello spazio aula certosinamente allestito per fare interagire gli alunni divertendosi.
The Libyans are rebelling against their government due to low income which has caused chaos and war between the government and rebels. The U.S. army is helping the Libyan government with evacuations which is affecting Libya's population as people leave the country due to the ongoing conflict and instability.
Energyst provides temporary rental solutions for cooling and power generation needs in data centers. They offer rental equipment such as chillers, power generators, UPS systems, and transformers to provide backup cooling and power on short notice for new facilities, extensions, emergency situations, and equipment testing. A technical specialist will create a customized plan for each rental, choosing reliable equipment and monitoring installations to ensure non-stop operations.
The CMS Innovation Center hosted a Beneficiary Engagement and Incentives: Direct Decision Support (DDS) Model webinar regarding the model overview and Letter of Intent (LOI) process on Thursday, January 12, 2017 from 2:00 - 3:00 p.m. EST. At this event, attendees learned more about the DDS model, eligibility criteria, and LOI requirements.
- - -
CMS Innovation Center
http://innovation.cms.gov
We accept comments in the spirit of our comment policy:
http://newmedia.hhs.gov/standards/comment_policy.html
CMS Privacy Policy
http://cms.gov/About-CMS/Agency-Information/Aboutwebsite/Privacy-Policy.html
In this August 14, 2012 webinar CMS Innovation Center staff provided additional information for states that are interested in applying for a Model Design award. Governors' offices were strongly encouraged to onvite their health care innovation team, key stakeholders and appropriate State officials such as State health department directors, Medicaid directors, and insurance commissioners.
- - -
CMS Innovations
http://innovations.cms.gov
We accept comments in the spirit of our comment policy:
http://newmedia.hhs.gov/standards/comment_policy.html
CMS Privacy Policy
http://cms.gov/About-CMS/Agency-Information/Aboutwebsite/Privacy-Policy.html
California is facing major budget cuts that will result in 19,000 teachers losing their jobs, negatively impacting the state's education system and these teachers' careers. The state of California is deep in debt and needs to cut costs, leading to widespread teacher layoffs that will hurt both students and teachers.
User Management Got You Down? Spiceworks Help Desk to the Rescue!Auskosh
User management tasks like tracking users, devices, tickets, and inventory can be simplified using Spiceworks. Spiceworks provides reports, plugins, and scripts to help with tasks like tying users to devices, setting up Active Directory integration, tracking technician work, finding locked out users, monitoring password expirations, locating logged in users, and more. Downloading extensions from the large library of Spiceworks resources can help IT professionals better manage their systems and make their lives easier.
In this July 26, 2012 webinar, CMS Innovation Center staff provided an overview of the State Innovation Models Initiative.
More information can be found at: http://innovations.cms.gov/initiatives/state-innovations/index.html.
- - -
CMS Innovation Center
http://innovation.cms.gov
We accept comments in the spirit of our comment policy:
http://newmedia.hhs.gov/standards/comment_policy.html
CMS Privacy Policy
http://cms.gov/About-CMS/Agency-Information/Aboutwebsite/Privacy-Policy.html
Social Media Case Studies Compilation #1 - 110210FullsourceWP
The document discusses three case studies from Visible Technologies about using their social media monitoring and engagement platform, Visible Intelligence. The first case study describes how TBWA\Chiat\Day used Visible Intelligence to track social media mentions of Grammy-nominated artists to power a "FanBuzz Visualizer." The second case discusses how Microsoft's Springboard team used Visible Intelligence to engage with the IT community and drive adoption of Windows 7. The third case outlines how Penn Schoen Berland uses social media data from Visible Intelligence along with traditional research to better predict box office results.
1. The document discusses operators and flow control in PHP including math operators, assignment operators, comparison operators, logical operators, and control structures like if/else statements, switch statements, loops, and functions.
2. Regular expressions and pattern matching are introduced as ways to validate user input data with functions like ereg(), split(), and ereg_replace(). Common patterns and character classes are explained.
3. Form validation is discussed including checking for empty fields, using custom arrays for form data, and redirecting with HTTP headers. Server variables are also described.
The document provides an overview of PHP (Hypertext Preprocessor), a popular server-side scripting language. It discusses key PHP concepts like variables, data types, operators, forms, and functions. Some key points covered include:
- PHP code is embedded within <?php ?> tags and can output and interact with HTML
- PHP supports common variable types like integers, floats, strings, and arrays
- Operators allow performing tasks like math operations and comparisons on variables
- Forms allow user input and are submitted via GET or POST methods to PHP scripts
- Functions help organize and reuse code when called within a PHP program
PHP is one of the simplest server-side languages out there, and it was designed primarily for web development. Learning PHP is good not only because it adds ...
This document provides an overview of PHP arrays including how to create, access, and traverse arrays. Key points covered include:
- PHP arrays can be indexed (like C arrays) or associative (like hashes in other languages).
- Common array functions allow checking properties, extracting keys/values, merging, slicing, and traversing arrays.
- Arrays can be iterated with loops like foreach to access elements sequentially.
So in summary, the document discusses the basic concepts and usage of PHP arrays, from creation and population to common manipulation and traversal techniques.
The document provides an introduction to PHP including PHP tags, comments, data types, variables, control structures, functions and more. It explains that PHP code is placed between <?php ?> tags and describes the different tags like <?php ?> for PHP code, <!-- --> for HTML comments. It also summarizes key PHP concepts like variables, arrays, strings, operators, if/else statements, loops, functions and built-in PHP functions.
The document discusses various PHP programming concepts like variables, data types, operators, control structures, and functions. It provides code examples to demonstrate how to work with variables, different data types, operators, conditional statements, loops, and functions in PHP. Various PHP concepts covered include strings, arrays, objects, constants, arithmetic operators, comparison operators, if/else statements, switch statements, while loops, for loops, and functions.
This document provides an overview of PHP and MySQL:
- PHP code is embedded into web pages and used to generate dynamic HTML content. It interacts with databases using MySQL.
- PHP supports variables, arrays, control structures, functions and object-oriented programming. Version 5 added improved OOP support.
- Templates can be used to separate application logic from user interface code for improved maintenance. Common techniques include using templates to modularize content.
The document provides an introduction to PHP including its history, features, syntax, variables, data types, operators, conditional statements, loops, functions and string operations. It discusses how to install PHP, integrate it with Apache and use PHP tags to distinguish code from HTML. It also covers declaring variables, constants, arithmetic, relational and logical operators, conditional statements like if/else, loops like for and while, math and string functions.
The document provides an introduction to PHP, including:
- PHP is a scripting language originally designed for web pages and runs on most operating systems.
- PHP syntax is quite easy if familiar with C-type languages, and it is designed to output to browsers but can also create CLI apps.
- Variables, constants, naming conventions, data types, and basic control structures like if/else, while loops and foreach loops are discussed.
- Combining PHP with XHTML is covered, recommending using functions and an object-oriented approach.
- User input via forms is mentioned, linking to a resource on processing forms with PHP.
The document discusses various types of expressions and operators in PHP. It describes expressions as bits of PHP code that evaluate to a value, including literal values and variables. Operators take operands and perform operations on them, such as arithmetic, comparison, logical, bitwise, and string operators. It provides examples of using different operators in PHP code and explains concepts like operator precedence, associativity, and type casting.
The document outlines the goals and structure of an underground PHP session for students. The session will cover PHP basics like where to get help, best practices for coding, and fundamental programming concepts. It will not provide direct code solutions but rather explain programming concepts. The session will focus on theory over specific coding examples. Key topics to be covered include PHP basics, data types, operators, and variables. Comments, indentation, and meaningful naming are emphasized as best practices.
PHP is a scripting language commonly used for web development. It allows dynamic generation of web page content through embedded PHP code. Some key things PHP can do include interacting with databases, processing user input, file handling, and more. PHP code is embedded within HTML using <?php ?> tags and variables, control structures, and other programming elements allow writing logic and dynamic functionality.
This document provides an overview of PHP basics including:
- How a web request is processed with PHP
- PHP syntax and tags
- Data types like scalars, arrays, and objects
- Variables, naming conventions, and scopes
- Language constructs like if/else, switch, loops, and functions
- Operators, error handling, and best practices for writing clear code
This document provides an overview of PHP and MySQL for web development. It describes what PHP and MySQL are, basic PHP syntax like variables and control structures, working with forms, and how to include files across pages using includes and requires.
This document provides an overview of PHP (Hypertext Preprocessor) including its introduction, syntax, variables, data types, operators, control flow statements and functions. PHP is a widely used open source scripting language that allows developers to execute code server-side to generate dynamic web page content. Some key points covered include:
- PHP code is placed within <?php ?> tags in HTML documents and executed on the server.
- It supports common data types like strings, integers, arrays and objects that can be stored and manipulated using variables and operators.
- Control structures allow conditional execution and loops like if/else, switch, while, do/while and for to control program flow.
- Functions
Watch Erik's presentation on PHP Unit Testing to gain familiarity with unit tests and unit testing here at Tagged, with the testing framework currently in place and also learn how to write (better) unit tests. Download his slides here or email him at ejohannessen@tagged.com.
The document discusses various control structures in PHP including if/else statements, loops (while, do/while, for, foreach), and jumping in and out of PHP mode. It provides examples of how to use each control structure and also discusses adding comments to PHP scripts.
This document provides an introduction and overview of key PHP concepts including variables, constants, strings, loops, conditional statements, functions, include/require, and variable scope. It includes code examples for while, do-while, for, and foreach loops. Conditional statements covered include if, elseif, else, switch, ternary operator. The document also discusses functions, passing by value vs reference, variable-length parameters, and returning values. It covers including/requiring files and variable scope rules. Finally, it provides exercises to reinforce the concepts.
Performance Budgets for the Real World by Tammy EvertsScyllaDB
Performance budgets have been around for more than ten years. Over those years, we’ve learned a lot about what works, what doesn’t, and what we need to improve. In this session, Tammy revisits old assumptions about performance budgets and offers some new best practices. Topics include:
• Understanding performance budgets vs. performance goals
• Aligning budgets with user experience
• Pros and cons of Core Web Vitals
• How to stay on top of your budgets to fight regressions
MYIR Product Brochure - A Global Provider of Embedded SOMs & SolutionsLinda Zhang
This brochure gives introduction of MYIR Electronics company and MYIR's products and services.
MYIR Electronics Limited (MYIR for short), established in 2011, is a global provider of embedded System-On-Modules (SOMs) and
comprehensive solutions based on various architectures such as ARM, FPGA, RISC-V, and AI. We cater to customers' needs for large-scale production, offering customized design, industry-specific application solutions, and one-stop OEM services.
MYIR, recognized as a national high-tech enterprise, is also listed among the "Specialized
and Special new" Enterprises in Shenzhen, China. Our core belief is that "Our success stems from our customers' success" and embraces the philosophy
of "Make Your Idea Real, then My Idea Realizing!"
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfjackson110191
These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.
Transcript: Details of description part II: Describing images in practice - T...BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
Implementations of Fused Deposition Modeling in real worldEmerging Tech
The presentation showcases the diverse real-world applications of Fused Deposition Modeling (FDM) across multiple industries:
1. **Manufacturing**: FDM is utilized in manufacturing for rapid prototyping, creating custom tools and fixtures, and producing functional end-use parts. Companies leverage its cost-effectiveness and flexibility to streamline production processes.
2. **Medical**: In the medical field, FDM is used to create patient-specific anatomical models, surgical guides, and prosthetics. Its ability to produce precise and biocompatible parts supports advancements in personalized healthcare solutions.
3. **Education**: FDM plays a crucial role in education by enabling students to learn about design and engineering through hands-on 3D printing projects. It promotes innovation and practical skill development in STEM disciplines.
4. **Science**: Researchers use FDM to prototype equipment for scientific experiments, build custom laboratory tools, and create models for visualization and testing purposes. It facilitates rapid iteration and customization in scientific endeavors.
5. **Automotive**: Automotive manufacturers employ FDM for prototyping vehicle components, tooling for assembly lines, and customized parts. It speeds up the design validation process and enhances efficiency in automotive engineering.
6. **Consumer Electronics**: FDM is utilized in consumer electronics for designing and prototyping product enclosures, casings, and internal components. It enables rapid iteration and customization to meet evolving consumer demands.
7. **Robotics**: Robotics engineers leverage FDM to prototype robot parts, create lightweight and durable components, and customize robot designs for specific applications. It supports innovation and optimization in robotic systems.
8. **Aerospace**: In aerospace, FDM is used to manufacture lightweight parts, complex geometries, and prototypes of aircraft components. It contributes to cost reduction, faster production cycles, and weight savings in aerospace engineering.
9. **Architecture**: Architects utilize FDM for creating detailed architectural models, prototypes of building components, and intricate designs. It aids in visualizing concepts, testing structural integrity, and communicating design ideas effectively.
Each industry example demonstrates how FDM enhances innovation, accelerates product development, and addresses specific challenges through advanced manufacturing capabilities.
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
How to Avoid Learning the Linux-Kernel Memory ModelScyllaDB
The Linux-kernel memory model (LKMM) is a powerful tool for developing highly concurrent Linux-kernel code, but it also has a steep learning curve. Wouldn't it be great to get most of LKMM's benefits without the learning curve?
This talk will describe how to do exactly that by using the standard Linux-kernel APIs (locking, reference counting, RCU) along with a simple rules of thumb, thus gaining most of LKMM's power with less learning. And the full LKMM is always there when you need it!
Details of description part II: Describing images in practice - Tech Forum 2024BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and transcript: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data.
The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs.
Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution!
Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
7 Most Powerful Solar Storms in the History of Earth.pdfEnterprise Wired
Solar Storms (Geo Magnetic Storms) are the motion of accelerated charged particles in the solar environment with high velocities due to the coronal mass ejection (CME).
Are you interested in learning about creating an attractive website? Here it is! Take part in the challenge that will broaden your knowledge about creating cool websites! Don't miss this opportunity, only in "Redesign Challenge"!
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
2. What is it? and What do I need? What is PHP ? PHP: Hypertext Preprocessor A server-side, cross-platform HTML embedded scripting language What do I need? PHP-enabled web server Text editor A way to get PHP scripts from your machine to the server
3. Basic Syntax Escaping from HTML <?php … ?> <script language=“php”> … </script> <? … ?> <% … %> For Example… <?php /* The world renowned first program. Programmer: Todd Barber Date: October 31, 2006 */ echo “Hello World!”; #displays on the screen // A simple program to illustrate just the basics ?>
4. Types Boolean -> TRUE or FALSE Integer – number of the set Z = {..., -2, -1, 0, 1, 2, ...} Float -> “decimal numbers” String – series of characters Single quote (‘) – doesn’t expand variables Double quote (“) – does expand variables Array – ordered map that assigns values to keys NULL – represents that a variable has no value. NULL is the only possible value. See http://us2.php.net/manual/en/language.types.php for all possible types and more details.
5. Variables Variables are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. $this_is_a_valid_variable $this-one-is-not
6. More Variables Predefined Variables $GLOBALS – all variables currently in the global scope $_SERVER – all variables set by the web server $_POST – variables provided by the HTTP POST $_GET – variables provides by the HTTP GET (in the URL) $_SESSION – variables currently registered with the script’s session
7. More Variables - Scope For the most part PHP variables have a single scope <?php $a=1; include ‘header_info.php’; ?> You can reference the $a variable in the file ‘header_info.php’ <?php $b=1; function footer_info () { echo $b; } footer_info(); ?> Nothing will output. The echo statement refers to the local scope of the variable (inside the function.) Global variables must be declared global inside the function.
8. More Variables – Scope Global Keyword <?php $a = 1; $b = 2; function Sum() { global $a, $b; $b = $a + $b; } Sum(); echo $b; ?> What is $b? Passing Variables <?php $a = 1; $b = 2; function Sum ($a, $b) { $b = $a + $b; } Sum($a, $b); echo $b; ?> What is $b? 3 2
9. More Variables - Variable Variable names which can be set and used dynamically <?php $a = ‘hello’; $$a = ‘world’; echo “$a ${$a}”; echo “$a $hello”; ?> Constants - value cannot change during the execution of the script A constant is case-sensitive by default. By convention, constant identifiers are always uppercase. <?php define (“PI”,”3.14159265358979323846”); echo PI; ?> This outputs hello world hello world This outputs 3.14159265358979323846
10. Operator Precedence Associativity Operators Additional Information non-associative new new left [ array() non-associative ++ -- increment/decrement non-associative ~ - (int) (float) (string) (array) (object) @ types non-associative instanceof types right ! logical left * / % arithmetic left + - . arithmetic and string left << >> bitwise non-associative < <= > >= comparison non-associative == != === !== comparison left & bitwise and references left ^ bitwise left | bitwise left && logical left || logical left ? : ternary right = += -= *= /= .= %= &= |= ^= <<= >>= assignment left and logical left xor logical left or logical left , (comma) many uses
11. Operators Arithmetic -$a is negation $a + $b is addition $a - $b is subtraction $a * $b is multiplication $a / $b is division (always returns float) $a % $b is modulus Assignment $a = 5 is NOT “equal to.” It is “gets set to” Combined operators +=, -=, *=, /=, %=, .=
12. More Operators Comparison $a == $b is equal $a === $b is identical (includes type) $a != $b is not equal $a <> $b is not equal $a !== $b is not identical $a < $b is less than $a > $b is greater than $a <= $b is less than or equal to $a >= $b is greater than or equal to Conditional ?: is ternary – expr1 ? expr2 : expr3 If expr1 is TRUE, the expression evaluates to expr2 If expr1 is FALSE, the expression evaluates to expr3 Shorthand for single expression if statements
13. Comparing Different Types Operand 1 Operand 2 Result Null or String String Convert NULL to “”, numerical or lexical comparison Bool or null Anything Convert to bool, FALSE<TRUE String or number (or resource) String or number (or resource) Translate strings (and resources) to numbers, usual math Array Array Array with fewer numbers is smaller If key from operand 1 is not found in operand 2 then arrays are incomparable Compare value by value Array Anything Array is always greater
14. More Operators Error Control @ - suppresses any errors that may be generated Works on expressions – if you can take a value of it then you can use it. Strings Concatenation (.) Concatenating Assignment (.=) <$php @include “header_info.php”; // suppress error if file doesn’t exist $a = “Hello”; // assign value Hello to $a $b = $a . “ World”; // $b evaluates to “Hello World” $a .= “ World”; // $a evaluates to “Hello World” ?>
15. More Operators Increment and Decrement ++$a – Preincrement – Increment by one, then return $a $a++ - Postincrement – Return $a, then increment by one --$a – Predecrement - Decrement by one, then return $a $a-- - Postdecrement - Return $a, then decrement by one <?php $a = 5; echo "Should be 5: " . $a++ . "<br />"; echo "Should be 6: " . $a . "<br />"; $a = 5; echo "Should be 6: " . ++$a . "<br />"; echo "Should be 6: " . $a . "<br />"; $a = 5; echo "Should be 5: " . $a-- . "<br />"; echo "Should be 4: " . $a . "<br />"; $a = 5; echo "Should be 4: " . --$a . "<br />"; echo "Should be 4: " . $a . "<br />"; ?>
16. More Operators Logical $a and $b is AND – TRUE if both are TRUE $a or $b is OR – TRUE if either is TRUE $a xor $b is XOR – TRUE if either is TRUE, but not both ! $a is NOT – TRUE is $a is not TRUE $a && $b is AND – TRUE if both are TRUE $a || $b is OR – TRUE if either is TRUE
17. More Operators Array $a + $b is union – appends the right side to the left side and doesn’t overwrite variables $a == $b is Equal – TRUE is they have the same key/value pairs $a === $b is Identity – TRUE if they have the same key/value pairs in the same order and of the same types $a != $b is Inequality – TRUE if $a is not equal to $b $a <> $b – Same as Inequality above $a !== $b is Non-identity – TRUE if $a not identical to $b
18. Array Comparisons <?php $a = array ("a" => "apple", "b" => "banana"); $b = array ("a" => "pear", "b" => "strawberry", "c" => "cherry"); $c = $a + $b; // Union of $a and $b echo "Union of a and b: "; var_dump ($c); $c = $b + $a; // Union of $b and $a echo "Union of b and a: "; var_dump ($c); ?> <?php $a = array ("apple", "banana"); $b = array (1 => "banana", "0" => "apple"); var_dump($a == $b); // bool(true) var_dump($a === $b); // bool(false) ?> <?php $a = array(1,2,3); $b = array(1,7,8,9,10); $c = $a + $b; // Union of $a and $b echo "Union of a and b: "; //echo $c print_r($c); ?>
19. Control Structures -- if if – evaluates an expression to its Boolean value – if the expression evaluates to TRUE then the conditional code is executed; otherwise it is ignored <?php $a = 5; if ($a = 6) echo “Hello World”; ?> <?php $a = 5; if ($a == 6) { echo “Hello World”; $b = 7; } ?> if block is executed and displays Hello World – note the assignment operator in the expression if block is ignored and nothing is done – note the comparison operator in the expression
20. Control Structures - else else – extension of if statement that executes code when the if expression evaluates to FALSE <?php $a=3; $b=4; if ($a < $b) echo “Variable A is less than B”; else echo “Variable B is less than A”; ?>
21. Control Structures - elseif elseif – another extension of if <?php $a=3; $b=4; if ($a < $b) { echo “Variable A is less than B”; } elseif ($a == $b) { echo “Variable A has the same value as B”; } else { echo “Variable B is less than A”; } ?>
22. Control Structures - while while – execute the statements as long as the expression evaluates to TRUE <?php $a=3; while ($a==4) { echo “The value of a is ”.$a; } ?> <?php $i = 1; while ($i <=10) { echo “i is set to “.$i++; } ?> <?php $j = 0; while ($j <=10) { echo “j is set to “.++$j; } ?> Counts to 10 Counts to 11
23. Control Structures – do-while do-while – same as while except the code chunk is guaranteed to execute at least once <?php $a=3; while ($a==4) { echo “The value of a is ”.$a; } ?> <?php $a=3; do { echo “The value of a is ”.$a; } while ($a==4); ?> Evaluates to FALSE and while loop statement(s) are never executed while expression isn’t evaluated until after at least one iteration of the do-while statements. This echoes “The value of a is 3” to the screen.
24. Control Structures - for for (expr1; expr2; expr3) { statement(s); } expr1 is evaluated unconditionally expr2 is evaluated at the beginning of each iteration; continues on TRUE expr3 is evaluated at end of iteration <?php for($i=1;$i<=10;$i++) { echo $i.”<br />”; } ?> <?php $i=1; while ($i<=10) { echo $i.”<br />”; $i++; } ?> functions the same as
25. Control Structures - switch switch – the same as a series of if…elseif statements <?php $i = 2; switch ($i) { case 0: echo $i; break; case 1: echo $i; break; case 2: echo $i; break; default: echo $i; break; ?> <?php $i=2; if ($i==0) echo $i; elseif ($i==1) echo $i; elseif ($i==2) echo $i; ?>
26. More switch <?php $i = 4; switch ($i) { case 0: case 1: case 2: case 3: echo “I is less than 4”; break; case 4: echo “I is equal to 4”; break; default: echo “I is greater than 4”; break; ?> Combining cases Omitting Breaks <?php $i = 4; switch ($i) { case 0: case 1: case 2: case 3: echo “I is less than 4”; case 4: echo “I is equal to 4”; default: echo “I is greater than 4”; ?>
27. Control Structures – require and include require – includes and evaluates a specific file; failure results in a Fatal Error <?php require ‘header.php’; ?> include - includes and evaluates a specific file; failure results in a Warning <?php include ‘header.php’; ?>
28. Control Structures –require_once and include_once require_once – same as require except if the file has already been included, it will not be included again <?php require_once ‘header.php’; ?> include_once - same as include except if the file has already been included, it will not be included again <?php include_once ‘header.php’; ?> Use when the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc.
29. User-defined functions Any valid PHP code can appear inside a function Names follow the same rules as other labels in PHP All functions in PHP have the global scope <?php function my_first_function ($arg1, $arg2, … ,$arg_n) //arguments aren’t mandatory { echo “PHP code goes here.”; return $return_value; //only used when something is returned } my_first_function(); // example of function call with no arguments my_first_function(1,2); // function with static arguments my_first_function($variable); // function with a variable as an argument }
30. Functions and Arguments Information can be passed to the function by the argument list, a comma separated value list of expressions Arguments may be passed by: Value (default) Reference Default argument list Variable-length argument lists are supported only in PHP4 and greater
31. Function Examples Passing by value examples <?php ######### NUMBERS ########### function add_numbers($value1, $value2) { echo “The numbers $value1 + $value2 equal “. $value1+$value2; } add_numbers(3,4); #adding 2 static numbers add_numbers($age1,$age2); #adding 2 ages given by a user from a form ######### STRING ########### function display_instructions() { echo “Text goes here. Great for text that changes often and is used many places.”; } display_instructions(); ######### ARRAYS ########### function add_array_values($func_array) { echo “The numbers $func_array[0] + $func_array[1] = “. $func_array[0] + $func_array[1]; } $main_program_array = array(2,3); add_array_values($array); ?>
32. More Function Examples Passing by Reference and Default Argument List <?php $dbc = OCILogon("A201","$password","$database"); function which_name($identifier,&$conn,$count="1") { //global $dbc; //$conn =& $GLOBALS['dbc']; if ($identifier == "last") $sql = "select t100_first_name, t100_last_name from a201t100 where t100_last_name like 'Q%'"; else $sql = "select t100_first_name, t100_last_name from a201t100 where t100_first_name like 'Q%'"; $stmt = OCIParse($conn,$sql); OCIExecute($stmt); while ($row=OCI_fetch_row($stmt)) { echo "<tr><td>".$count++."</td><td>$row[0] $row[1]</td></tr>";} OCIFreeStatement($stmt); OCILogoff($conn); } echo "<table border='1' cellpadding='3’ width='30%'><tr><td>Count</td><td>Name</td></tr>“; which_name("first",$dbc); echo"</table>"; ?>
33. More Function Examples Passing by reference notes Used when you want to change the value of the object you passed in I don’t know of a realistic use except when using classes. Can be used to return more than one value from a function (more on that later). Passing by default argument list Any defaults must be on the right side of the argument list Must be a constant expression Uses default unless specified otherwise
34. Variable length argument lists Uses the func_num_args() , func_get_arg() , and func_get_args() functions. <?php function math() { $numargs = func_num_args(); echo "Number of arguments: $numargs<br />"; echo "The second side is: " . func_get_arg(1) . "<br />"; $arg_list = func_get_args(); for ($i = 1; $i < $numargs +1; $i++) { echo "Side $i is: " . $arg_list[$i -1] . "<br />"; $area += $arg_list[$i -1]; } return $area; } $area_of_object = math(3,4,5,6,1); // Prints 'Number of arguments: 5' echo "The area of the object is $area_of_object"; ?>
35. Returning values A value can be returned by using the optional return() statement Function execution is ended immediately and control passed back to the line that called the function Returns a single variable could be a single number or string could be an array with several values
36. return() examples Single number <?php function square($num) { return $num * $num; } echo square(5); //displays 25 ?> Single String <?php function display($string1, $string2=“World”) { return $string1 . $string2; } echo display(“Hello”,” Todd”);// displays Hello Todd echo display(“Hello ”);//displays Hello World ?>
37. More return() examples Array – use the built-in list() function to access the array elements <?php function math($num1, $num2) { $div = $num1 / $num2; $mutli = $num1 * $num2; $add = $num1 + $num2; $sub = $num1 - $num2; return array($div, $mutli, $add, $sub); } list ($d, $m, $a, $s) = math("6","2"); echo "Division: $d"; echo "<br />Multiplication:". $m; echo "<br />Addition: $a"; echo "<br />Subtraction: $s"; ?>
38. More return() examples Passing by reference to return multiple values <?php function split_string($input, $cut_point, &$first, &$second) { if(strlen($input) < $cut_point) return false; $first = substr($input, 0, $cut_point); $second = substr($input, $cut_point); return true; } $input_text = "abcdefghijklmnopqrstuvwxyz"; if(split_string($input_text, 30, $first_half, $second_half) != true) { echo "Could not split input, cut-point is entire string!<br />"; } if(split_string($input_text, 15, $first_half, $second_half) == true) { echo "First segment of input: $first_half<BR>"; echo "Second segment of input: $second_half<BR>"; } ?>
39. Oh, by the way… You can also return by reference. See http://www.php.net/manual/en/language.references.return.php for a simple example and some explanation Remember variable variables? (Slide 9) PHP also allows for variable functions <?php function display() { echo “In a function…”; } $variable_function = “display”; $variable_function(); ?> Built in Functions - http://www.php.net/manual/en/funcref.php Sessions - http://www.php.net/manual/en/ref.session.php Oracle - http://www.php.net/manual/en/ref.oci8.php Strings - http://www.php.net/manual/en/ref.strings.php Date & Time - http://www.php.net/manual/en/ref.datetime.php Arrays - http://www.php.net/manual/en/ref.array.php File System - http://www.php.net/manual/en/ref.filesystem.php PDF - http://www.php.net/manual/en/ref.filesystem.php
Since everything is HTML embedded, must have a way of telling the server what is PHP and what is HTML. 1 and 2 are both always available, however number 1 is used most often. 3 and 4 are only available if enabled by the server administrator. Closing tag is optional. Lines of code must end in PHP.
Don’t add scope until talking about functions b/c examples don’t make sense until then.
Don’t add scope until talking about functions b/c examples don’t make sense until then.
Form with 8 names and name1, name2, etc… and it gets submitted For loop 8 times: $temp_name = name$i echo $$temp_name // holds the actual value from the form. End of for
String to number- if string starts with number or sign then it gets that value, if it starts with anything else it gets evaluated to zero.
Two different variations of AND and OR because they have different precedence
Point out that on single command if statements the curly braces are optional.
for ($i=1;$i<=10;print $i++) More on for the expressions can be blank or have multiple expressions in them. Go to php.net for more