This document provides an overview of how to interpret code to understand what a program is doing without running it. It discusses using code comments, function names, variable names, file locations, print functions, file names and other variables to understand the program's purpose. Specific programming languages are also discussed including examples of "Hello World" programs in Java, JavaScript, C, C#, PHP, Perl, Ruby and Python.
Functions are blocks of code that perform tasks and can be reused. Large projects require functions to organize code and avoid repetition. Functions accept input, process it, and return output. Functions can be built-in to PHP or user-defined. User-defined functions are created using the function keyword and can accept arguments passed by value or reference. Arrays allow storing multiple values and are indexed with keys and values. Arrays can be numerically or associatively indexed.
The document discusses functions in PHP, including defining functions, passing arguments to functions, returning values from functions, and using global variables. Some key points covered include:
- Functions allow code to be reused and separated into logical subsections, making code more modular, readable, and maintainable.
- Arguments passed to functions can make functions more flexible by allowing different inputs to produce different outputs each time they are called.
- Functions can return values to the calling code using the return statement. Returned values can be variables, arrays, or results of calculations.
- The order arguments are passed to a function matters, as arguments are assigned to placeholder variables in the defined order. Default values can be specified for arguments.
Introduction to web programming with JavaScriptT11 Sessions
This document provides an overview of web programming with JavaScript. It discusses topics like:
- HTML and CSS which are used to structure and style web pages
- How browsers interpret HTML, CSS, and JavaScript to display web pages
- What backend and frontend development involve
- Common JavaScript concepts like variables, operators, functions, and events
- Tools that can be used for web development like text editors, browsers, and version control software
- Resources for learning more about JavaScript and web programming
This is the second set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
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
The document discusses JavaScript and some of its key features:
- JavaScript is the programming language of the web browser and was originally developed by Netscape under different names before being standardized.
- JavaScript uses a prototypal object model instead of classes, with objects inheriting directly from other objects via prototypal inheritance chains rather than from classes.
- The "new" keyword is used to create objects but can give the misleading impression of classes; functions can also be used to create objects without "new" by returning the object.
Functions are blocks of code that perform tasks and can be reused. Large projects require functions to organize code and avoid repetition. Functions accept input, process it, and return output. Functions can be built-in to PHP or user-defined. User-defined functions are created using the function keyword and can accept arguments passed by value or reference. Arrays allow storing multiple values and are indexed with keys and values. Arrays can be numerically or associatively indexed.
The document discusses functions in PHP, including defining functions, passing arguments to functions, returning values from functions, and using global variables. Some key points covered include:
- Functions allow code to be reused and separated into logical subsections, making code more modular, readable, and maintainable.
- Arguments passed to functions can make functions more flexible by allowing different inputs to produce different outputs each time they are called.
- Functions can return values to the calling code using the return statement. Returned values can be variables, arrays, or results of calculations.
- The order arguments are passed to a function matters, as arguments are assigned to placeholder variables in the defined order. Default values can be specified for arguments.
Introduction to web programming with JavaScriptT11 Sessions
This document provides an overview of web programming with JavaScript. It discusses topics like:
- HTML and CSS which are used to structure and style web pages
- How browsers interpret HTML, CSS, and JavaScript to display web pages
- What backend and frontend development involve
- Common JavaScript concepts like variables, operators, functions, and events
- Tools that can be used for web development like text editors, browsers, and version control software
- Resources for learning more about JavaScript and web programming
This is the second set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
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
The document discusses JavaScript and some of its key features:
- JavaScript is the programming language of the web browser and was originally developed by Netscape under different names before being standardized.
- JavaScript uses a prototypal object model instead of classes, with objects inheriting directly from other objects via prototypal inheritance chains rather than from classes.
- The "new" keyword is used to create objects but can give the misleading impression of classes; functions can also be used to create objects without "new" by returning the object.
This document provides an introduction to Perl and BioPerl for bioinformatics. It discusses Jennifer Dommer and Vivek Gopalan from the National Institute of Allergy and Infectious Diseases presenting on Perl programming principles including variables, flow control, loops, file manipulation and regular expressions. It then provides an overview of BioPerl and how it can be used for tasks like working with sequence data. Examples are given throughout to demonstrate various Perl coding concepts.
The document discusses object oriented concepts in PHP. Some key points:
- PHP 5 introduced a complete object oriented programming model, allowing PHP programmers to code like Java and C#.
- Object oriented programming in PHP revolves around classes, which act as templates to define objects. Classes contain properties (variables) and methods (functions).
- The document provides a step-by-step process for developing an object oriented PHP application, including creating classes, instantiating objects from classes, setting and getting object properties and methods, and restricting access using modifiers.
This is the seventh set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Subroutines allow programmers to organize, reuse, and recall code. They are defined using the sub keyword followed by the subroutine name and block of code. Subroutines are called using an ampersand and the name, without parentheses. By default, the last operation in a subroutine is returned. Return values can be stored and used later in the main script. Well-structured subroutines improve code quality.
PHP is a scripting language commonly used for web development. It has tags like <?php ?> to denote code blocks. It supports common programming constructs like variables, data types, operators, conditional statements and loops. Variables start with $ and can be of types like integers, floats, strings, arrays and objects. PHP is loosely typed and performs automatic type conversions. Errors can be fatal, recoverable or warnings and notices.
This document discusses object-oriented programming (OOP) concepts in PHP. It covers the history of OOP and procedural programming, the benefits of OOP like reusability and security, OOP terminology like classes and objects, and differences between OOP implementations in PHP4 and PHP5 like access modifiers. Advantages of OOP include reusable and maintainable code, while disadvantages include more code required and a learning curve for procedural programmers.
Marko Heijnen discussed creating native mobile apps with WordPress. He explained that mobile is growing and developers may want to create native apps. The API currently uses XML-RPC but JSON is an alternative. Developers need to communicate with mobile developers to build an API and additional fields. Methods like getRecentPosts retrieve post data. Plugins like JSON API can be used to support JSON. Developers should return minimal data and cache responses. Special post types and admin pages can manage mobile content and push notifications. WordPress is flexible and can power mobile apps.
Perl is a highly capable programming language that can be used in both procedural and object-oriented styles, and is well-suited for text processing tasks like CGI programming. The document provides an introduction to basic Perl concepts like scalar and array variables, hashes, file handling, and control structures. It also demonstrates how to define and manipulate strings, arrays, and files in Perl code examples.
This document contains interview questions and answers related to Ruby and Ruby on Rails. It includes questions about Ruby gems, the difference between symbols and strings, the purpose of yield, class variables vs instance variables vs global variables, constructors and method overloading in Ruby, ranges, and implementing singleton pattern. Detailed explanations and code examples are provided for many of the questions.
This chapter discusses working with text and numbers in PHP. It covers defining and manipulating strings, including validating, formatting, and changing case. Functions for selecting, replacing, and exploding parts of strings are described. Working with numbers, math operators, variables, and number formatting functions are also summarized. Key string functions include substr(), str_replace(), printf(), and number functions include rand(), round(), pow(), and abs().
A Perl subroutine is a block of code that performs a specific task. Subroutines allow code to be reused and executed from different parts of a program with different parameters. They are defined using the "sub" keyword followed by the subroutine name and code block. Subroutines can accept arguments, return values, and contain private variables scoped to the subroutine using the "my" keyword. This modular approach improves code organization, reusability, and maintainability.
The document discusses various techniques for querying databases and generating reports from the query results using Perl. It provides examples of using DBI and SQL to query databases and format output, techniques for binding variables, preparing queries, and fetching and printing rows. Additional examples show merging and transforming tabular data for different output formats.
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.
This document outlines PHP functions including function declaration, arguments, returning values, variable scope, static variables, recursion, and useful built-in functions. Functions are blocks of code that perform tasks and can take arguments. They are declared with the function keyword followed by the name and parameters. Functions can return values and arguments are passed by value by default but can also be passed by reference. Variable scope inside functions refers to the local scope unless specified as global. Static variables retain their value between function calls. Recursion occurs when a function calls itself. Useful built-in functions include function_exists() and get_defined_functions().
This document provides an introduction to PHP by outlining its key topics and features. It explains that PHP can be used for server-side web development, command-line scripting, and client-side GUI applications. The document then walks through variables, data types, operators, control structures, and loops in PHP. It provides examples to illustrate PHP syntax and best practices.
One of the advantages of learning a new language is being exposed to new idioms and new approaches to solving old problems. In this talk, we will introduce the Ruby language with particular focus on the idioms and concepts that are different from what is found in Java.
We will introduce concepts such as closures, continuations and meta programming. We will also examine powerful techniques that are practically impossible in Java due to its compile time binding of types.
No experience with Ruby is assumed although an understanding of Java would be helpful.
This talk was given at the Toronto Java Users Group in April 2008
Class 7 - PHP Object Oriented ProgrammingAhmed Swilam
This document provides an overview of object-oriented programming (OOP) concepts in PHP. It discusses previous programming trends like procedural and structured languages. It then covers key OOP concepts like classes, objects, inheritance, polymorphism, and abstraction. Specific PHP OOP features are explained like class diagrams, access modifiers, constructors, destructors, static members, and class constants. Examples are provided to demonstrate classes, inheritance, polymorphism, abstract classes, interfaces, and exceptions. The document concludes with an assignment to model person, student, and teacher relationships using PHP classes.
Preparing for the next PHP version (5.6)Damien Seguy
With versions stretching from 5.3 to 5.6, PHP has several major published versions, that require special attention when migrating. Beyond checking for compilation, the code must be reviewed to avoid pitfalls like obsoletes functions, new features, change in default parameters or behavior. We'll set up a checklist of such traps, and ways to find them in the code and be reading for PHP 5.6.
The document outlines an agenda for a new manager boot camp being led by Eeshita Grover and Charles Rygula. It includes introductions of the presenters and an exercise for attendees to share their views on management and content. Additional topics cover understanding one's span of control and influence, conducting a content inventory and audit, and suggested discussion topics from attendees like project management, tools, content value, and employee communication. Attendees are also invited to an additional presentation on communications.
This document provides an introduction to Perl and BioPerl for bioinformatics. It discusses Jennifer Dommer and Vivek Gopalan from the National Institute of Allergy and Infectious Diseases presenting on Perl programming principles including variables, flow control, loops, file manipulation and regular expressions. It then provides an overview of BioPerl and how it can be used for tasks like working with sequence data. Examples are given throughout to demonstrate various Perl coding concepts.
The document discusses object oriented concepts in PHP. Some key points:
- PHP 5 introduced a complete object oriented programming model, allowing PHP programmers to code like Java and C#.
- Object oriented programming in PHP revolves around classes, which act as templates to define objects. Classes contain properties (variables) and methods (functions).
- The document provides a step-by-step process for developing an object oriented PHP application, including creating classes, instantiating objects from classes, setting and getting object properties and methods, and restricting access using modifiers.
This is the seventh set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Subroutines allow programmers to organize, reuse, and recall code. They are defined using the sub keyword followed by the subroutine name and block of code. Subroutines are called using an ampersand and the name, without parentheses. By default, the last operation in a subroutine is returned. Return values can be stored and used later in the main script. Well-structured subroutines improve code quality.
PHP is a scripting language commonly used for web development. It has tags like <?php ?> to denote code blocks. It supports common programming constructs like variables, data types, operators, conditional statements and loops. Variables start with $ and can be of types like integers, floats, strings, arrays and objects. PHP is loosely typed and performs automatic type conversions. Errors can be fatal, recoverable or warnings and notices.
This document discusses object-oriented programming (OOP) concepts in PHP. It covers the history of OOP and procedural programming, the benefits of OOP like reusability and security, OOP terminology like classes and objects, and differences between OOP implementations in PHP4 and PHP5 like access modifiers. Advantages of OOP include reusable and maintainable code, while disadvantages include more code required and a learning curve for procedural programmers.
Marko Heijnen discussed creating native mobile apps with WordPress. He explained that mobile is growing and developers may want to create native apps. The API currently uses XML-RPC but JSON is an alternative. Developers need to communicate with mobile developers to build an API and additional fields. Methods like getRecentPosts retrieve post data. Plugins like JSON API can be used to support JSON. Developers should return minimal data and cache responses. Special post types and admin pages can manage mobile content and push notifications. WordPress is flexible and can power mobile apps.
Perl is a highly capable programming language that can be used in both procedural and object-oriented styles, and is well-suited for text processing tasks like CGI programming. The document provides an introduction to basic Perl concepts like scalar and array variables, hashes, file handling, and control structures. It also demonstrates how to define and manipulate strings, arrays, and files in Perl code examples.
This document contains interview questions and answers related to Ruby and Ruby on Rails. It includes questions about Ruby gems, the difference between symbols and strings, the purpose of yield, class variables vs instance variables vs global variables, constructors and method overloading in Ruby, ranges, and implementing singleton pattern. Detailed explanations and code examples are provided for many of the questions.
This chapter discusses working with text and numbers in PHP. It covers defining and manipulating strings, including validating, formatting, and changing case. Functions for selecting, replacing, and exploding parts of strings are described. Working with numbers, math operators, variables, and number formatting functions are also summarized. Key string functions include substr(), str_replace(), printf(), and number functions include rand(), round(), pow(), and abs().
A Perl subroutine is a block of code that performs a specific task. Subroutines allow code to be reused and executed from different parts of a program with different parameters. They are defined using the "sub" keyword followed by the subroutine name and code block. Subroutines can accept arguments, return values, and contain private variables scoped to the subroutine using the "my" keyword. This modular approach improves code organization, reusability, and maintainability.
The document discusses various techniques for querying databases and generating reports from the query results using Perl. It provides examples of using DBI and SQL to query databases and format output, techniques for binding variables, preparing queries, and fetching and printing rows. Additional examples show merging and transforming tabular data for different output formats.
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.
This document outlines PHP functions including function declaration, arguments, returning values, variable scope, static variables, recursion, and useful built-in functions. Functions are blocks of code that perform tasks and can take arguments. They are declared with the function keyword followed by the name and parameters. Functions can return values and arguments are passed by value by default but can also be passed by reference. Variable scope inside functions refers to the local scope unless specified as global. Static variables retain their value between function calls. Recursion occurs when a function calls itself. Useful built-in functions include function_exists() and get_defined_functions().
This document provides an introduction to PHP by outlining its key topics and features. It explains that PHP can be used for server-side web development, command-line scripting, and client-side GUI applications. The document then walks through variables, data types, operators, control structures, and loops in PHP. It provides examples to illustrate PHP syntax and best practices.
One of the advantages of learning a new language is being exposed to new idioms and new approaches to solving old problems. In this talk, we will introduce the Ruby language with particular focus on the idioms and concepts that are different from what is found in Java.
We will introduce concepts such as closures, continuations and meta programming. We will also examine powerful techniques that are practically impossible in Java due to its compile time binding of types.
No experience with Ruby is assumed although an understanding of Java would be helpful.
This talk was given at the Toronto Java Users Group in April 2008
Class 7 - PHP Object Oriented ProgrammingAhmed Swilam
This document provides an overview of object-oriented programming (OOP) concepts in PHP. It discusses previous programming trends like procedural and structured languages. It then covers key OOP concepts like classes, objects, inheritance, polymorphism, and abstraction. Specific PHP OOP features are explained like class diagrams, access modifiers, constructors, destructors, static members, and class constants. Examples are provided to demonstrate classes, inheritance, polymorphism, abstract classes, interfaces, and exceptions. The document concludes with an assignment to model person, student, and teacher relationships using PHP classes.
Preparing for the next PHP version (5.6)Damien Seguy
With versions stretching from 5.3 to 5.6, PHP has several major published versions, that require special attention when migrating. Beyond checking for compilation, the code must be reviewed to avoid pitfalls like obsoletes functions, new features, change in default parameters or behavior. We'll set up a checklist of such traps, and ways to find them in the code and be reading for PHP 5.6.
The document outlines an agenda for a new manager boot camp being led by Eeshita Grover and Charles Rygula. It includes introductions of the presenters and an exercise for attendees to share their views on management and content. Additional topics cover understanding one's span of control and influence, conducting a content inventory and audit, and suggested discussion topics from attendees like project management, tools, content value, and employee communication. Attendees are also invited to an additional presentation on communications.
Dokumen tersebut memberikan penjelasan mengenai proses menstruasi pada wanita, meliputi definisi menstruasi, proses terjadinya, hormon yang mempengaruhinya, fase-fase siklus menstruasi, dan gambaran singkat tentang proses fertilisasi.
El documento habla sobre tres valores: la solidaridad, el respeto y la puntualidad. La solidaridad se define como la conciencia de las necesidades de los demás y el deseo de ayudarlos. El respeto es un sentimiento positivo que implica veneración y aprecio por otras personas o cosas. La puntualidad es coordinarse cronológicamente para cumplir con una tarea u obligación en el tiempo acordado.
Ahsanul Kabir is seeking a position as an Engine Cadet. He has experience serving as an Engine Cadet aboard the M.V. Golam-e-Mostafa for 3 months and 9 days. He holds certificates in Personal Safety and Social Responsibilities, Personal Survival Techniques, Elementary First Aid, Fire Prevention and Fire Fighting, Ship Security Awareness and Designated Security Duties, and International Safety Management Code Familiarization. Kabir completed his BMS from the Bangladesh Marine Academy in 2013 and has good communication and problem solving skills.
Python is a popular coding language yet many are not aware of how many programs runs with the help of this language. You can do pretty much anything you desire to do with this very practical programming language. This language is preferred by many software developers during compilation and testing. It is also opted for studying by many students. It is also preferred by most beginners to know this language. There are number of websites written in Python. Can you believe that Google and You Tube has its programs written in Python? Not only these website, several others like Hipmunk, Spotify, Dropbox, Quora and many more.
Graphic designing is a process of visual communication and web development is the process of making it live and available worldwide. Both goes hand in hand and has good scope in the growth of industry. This creative process of combining art and technology is enhanced with the help of several tools. Every designer requires tools to complete his/her job at its best. One of our suggestion is 'Webydo' which is liked by all designers. This tool helps to create great designs without having to do the coding. 'Invision' is another such tool that allows to create interactive prototypes- one of the most powerful design prototyping tool. Responsive websites are mostly preferred by all designers as well as clients making the website support on all devices. But when it comes to emails, this is not easily available. 'Ink' is one such tool that allows to create responsive HTML emails. One interesting tool is 'Info gram' which helps you create info graphics by just loading your data. The list goes on with more varieties and helpful tools. Last but not the least is the 'Skill share' tool. This feature helps learners gain more knowledge and also upload their works.
Este documento ofrece 13 consejos sobre las relaciones y la vida. Algunos consejos incluyen valorar a las personas por cómo nos hacen sentir en lugar de quiénes son, no desperdiciar el tiempo con alguien que no está disponible, y ser la mejor versión de uno mismo antes de involucrarse con alguien más. El documento en general enfatiza la importancia de las conexiones humanas significativas y de mantener una actitud positiva ante la vida.
The WRAP (Wellness Recovery Action Plan) program is an evidence-based system used worldwide to help people dealing with mental health or other health challenges to improve wellness. It was developed by people with lived experience of mental health issues. The WRAP process involves identifying personal wellness tools and developing action plans to use in difficult situations. It also includes a crisis plan. The goals of WRAP are to teach recovery and self-management skills to promote higher wellness and quality of life while decreasing health costs and trauma. Expected long-term outcomes include reduced health services use as people effectively manage their own wellness using self-help techniques and support networks. Research shows WRAP is an effective evidence-based program.
Building maintainable javascript applicationsequisodie
In this presentation I share some tips about how to improve the quality and readability of JavaScript code, more specifically:
- Object Oriented JavaScript (comparing JS with Java)
- Bad practices
- Good practices
- Guidelines
- Recommended books
In-Depth Guide On WordPress Coding Standards For PHP & HTMLeSparkBiz
Before going to into the details of WordPress Coding Standards, you need to know the purpose of the coding standards & why you need to have coding standards.
In this blog, we will focus on part 1 – WordPress Coding Standards For PHP & HTML and in the next blog, we will focus on part 2 – WordPress Coding Standards For CSS & JS.
MyApp provides JavaScript best practices including:
1) Using namespaces to avoid naming collisions and define packages like MyApp.string.utils for reusable functions.
2) Branching code during initialization or lazily on first use to handle browser differences efficiently.
3) Passing configuration as an object instead of many parameters to simplify function calls.
4) Defining private methods and properties using closures to encapsulate code.
5) Employing self-executing functions for one-time initialization tasks.
6) Allowing method chaining for readability when calling several related methods.
This document discusses PHP functions and modularity. It explains why functions are used to organize code and avoid repetition. Built-in PHP functions are powerful, and custom functions can be created by defining them with the function keyword. Functions can take arguments, return values, and be called by reference. Variable scope is also covered, noting that function variables are usually isolated unless declared global. The document demonstrates including other files to split code into multiple files and check for function existence. Overall it provides an overview of functions and modularity in PHP.
This document discusses PHP functions and modularity. It explains why functions are used to organize code and avoid repetition. Built-in PHP functions are powerful, and custom functions can be created by defining them with the function keyword. Functions can take arguments, return values, and be called by reference. Variable scope is also covered, noting that function variables are usually isolated unless declared global. The document demonstrates including other files to split code into multiple files and check for function existence. Overall it provides an overview of functions and modularity in PHP.
This document provides an overview of JavaScript concepts and features. It introduces JavaScript, its uses, basic syntax like variables, operators, and popup boxes. It also covers conditional statements, loops, functions, arrays, objects like Date and Math objects, regular expressions, and cookies. The document is intended as an introduction to JavaScript for learning its basic concepts.
The document provides an introduction and overview of PHP, including:
- PHP is a server-side scripting language used for web development and can be embedded into HTML. It is commonly used to manage dynamic content, databases, sessions, and build ecommerce sites.
- Common uses of PHP include handling forms, accessing and modifying database elements, setting and accessing cookies, and restricting user access to website pages.
- The document then covers PHP syntax, variables, operators, conditional statements, loops, and arrays to provide the basic building blocks of the language.
1. In Java, all variable values are either primitives or references to objects. References are passed by value, so changes to referenced objects are visible outside method calls.
2. Java does not allow pointer arithmetic or dereferencing like in C++. References handle object access automatically.
3. Polymorphism in Java includes method overriding, overloading, and dynamic binding which allows subclasses to provide specific implementations of methods at runtime.
1. In Java, all variable values are either primitives or references to objects. References are passed by value, so changes to referenced objects are visible outside method calls.
2. Java does not allow pointer arithmetic or dereferencing like in C++. References handle object access automatically.
3. Polymorphism in Java includes method overriding, overloading, and dynamic binding which allows subclasses to provide specific implementations of methods at runtime.
This document discusses shell functions in Bash. It covers creating functions, passing parameters to functions, returning values from functions, and nested functions. Some key points:
- Functions enable breaking scripts into logical subsections that can be called to perform tasks. This makes scripts easier to maintain and reuse code.
- Parameters can be passed to functions and accessed using $1, $2, etc. Functions can return status codes.
- Nested functions allow one function to call another. Functions can also call themselves recursively.
- Variables declared inside functions are local and discarded when the function exits.
The document provides an overview of Ruby on Rails and its key components. It discusses how Rails is made up of several gems including Rails, ActiveSupport, ActionPack, ActiveRecord, ActiveResource and ActionMailer. It summarizes the purpose and functionality of each gem. For example, it states that ActiveRecord connects classes to database tables for persistence, while ActionPack handles routing, controllers and views.
- Ruby is an interactive, object-oriented programming language created by Yukihiro Matsumoto in 1995.
- Ruby on Rails is a web application framework built on Ruby that emphasizes convention over configuration and is optimized for programmer happiness.
- The document discusses Ruby and Ruby on Rails, providing an overview of their history, key principles like MVC, REST, and conventions used in Rails. It also provides examples of modeling data with classes and ActiveRecord in Rails.
Some javascript testing patterns that has made writing tests at Refinery29 more maintainable. Covered in this presentation is userContext (or let) in Jasmine, lazy evaluation and shared behavior.
The document discusses tools and techniques for making Java development more enjoyable. It recommends using libraries like Mockito, Guice and Guava to simplify testing and dependency injection. It also suggests using builder patterns, writing concise yet descriptive unit tests, and avoiding string-typing in favor of object-oriented types.
OGNL is an expression language used in Struts 2 to retrieve values from the value stack, which holds objects used by actions. OGNL expressions can be used in JSP views and XML configuration files to extract values. Struts 2 provides tags for control flow, data retrieval, and creating UI elements to build model-view-controller web applications. Validation can be done declaratively using XML files or programmatically in Java code.
This document provides an overview of Java essentials including:
- Java addressed issues with C/C++ like inconsistent frameworks and memory management issues.
- Java introduced a common framework, garbage collection, and object oriented programming.
- The history of Java versions from 1.0 to 6.0 is summarized.
- A simple "Hello World" Java program is broken down and explained.
This document contains questions and answers about PHP. It discusses PHP variable names, data types, functions like include(), require(), echo and print, arrays, object oriented concepts like inheritance and constants. It also covers regular expressions, error handling, strings, files and directories.
Web Typography is exploding all over the web, we made a jQuery plugin to give you control over those new fonts. We also made this powerpoint for a talk on the same subject.
Ruby makes it easy to create domain specific languages (DSLs) in two main ways:
1) Internal DSLs extend and customize the syntax and semantics of Ruby to achieve domain-specific needs, while external DSLs define their own custom syntax that requires a parser.
2) Techniques like method parameters, blocks, instance evaluation, method missing, and core extensions allow Ruby code to take on the feel of a specialized language within a domain.
3) Popular Ruby frameworks like Rails contain many internal DSLs that customize Ruby for tasks like defining routes, models, and more using these techniques.
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.
Similar to STC 2016 Programming Language Storytime (20)
2. About Me
Jason (hubby!)
Backend Perl developer,
extremely patient about being
my in-home tutor, taught me a
whole lot of The Things.
Sarah Kiniry (me!)
Technical Writer, former Stage
Manager and Box Office Manager,
needs-an-intervention level
Trekkie.
technicolorwriter.com
@SarahKiniry
@SarahKiniry
#STC16
3. If you can learn to read,
you can learn to read code.
4. Just read the story!
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
6. Code Clues
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
Code Comments
Function Names
Variable (Setting) Names
File Locations
Print Functions
Files
Directories
Variables
Code comments, function names,
setting names, and file locations.
Display methods, like print, and
other output functions.
File names, file paths, and other
variables.
@SarahKiniry
#STC16
7. Comments
Text in code that the computer doesn’t try to run.
Instead, it’s there for the developer’s reference.
Sometimes, it’s also used to temporarily “turn off”
code without deleting it.
8. Comments
// Single-line comments
// require a comment
// for each line.
do(thing); // comment
/* Multi-line
comments use beginning
and end characters for
multiple lines. */
Single-line comments…
• Can be used on the same line as code (a
trailing comment).
• Comment character at the beginning of the
comment only.
• A line break ends the comment.
Multi-line comments…
• Comment character at the beginning and
end of the comment.
• Generally, these exist on separate lines
from the code.
@SarahKiniry
#STC16
9. Single Line
// Java, JavaScript, C, C#, PHP
# PHP, Perl, Ruby, Python
@SarahKiniry
#STC16
10. Multi Line
/* Comment */ Java, JavaScript, C, C#, PHP
// Comment
Comment
C
=pod
=cut
Perl
=begin
=end
Ruby
""" """ Python
@SarahKiniry
#STC16
11. Functions
Reusable code that performs one or more actions.
Sometimes, the code that you’re looking at is a
function, while sometimes it uses existing functions.
* This is a lazy use of the term. These actions can be
subroutines, methods, procedures, etc.
12. Functions
sub do_something {
my $value = @_;
if $value {
return "Yay!";
}
…
do_something($value);
Function definition…
• Includes all of the code that will run
anytime the function is used.
• Creating a function that’s used elsewhere.
• Sets the function name.
Function use…
• Could be a custom-written function, or one
that’s built into the programming language.
• Often, custom functions are defined in
other code, not in the same file.
@SarahKiniry
#STC16
14. Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
15. Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
// This example defines a function.
public static void printyay() {
System.out.println ("Yay!");
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
16. Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
// This example defines a function.
public static void printyay() {
System.out.println ("Yay!");
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
17. Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
// This example defines a function.
public static void printyay() {
System.out.println ("Yay!");
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
Yay!
18. Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
C
@SarahKiniry
#STC16
19. Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
// This example defines a function.
int printyay() {
printf("Yay!");
}
C
@SarahKiniry
#STC16
20. Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
// This example defines a function.
int printyay() {
printf("Yay!");
}
C
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
21. Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
// This example defines a function.
int printyay() {
printf("Yay!");
}
C
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
Yay!
22. Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
JavaScript, PHP
@SarahKiniry
#STC16
23. Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
// This example defines a function.
function multiply(a,b) {
return a * b;
}
JavaScript, PHP
@SarahKiniry
#STC16
24. Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
// This example defines a function.
function multiply(a,b) {
return a * b;
}
JavaScript, PHP
@SarahKiniry
#STC16
// This uses the defined function.
multiply(3,2);
25. Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
// This example defines a function.
function multiply(a,b) {
return a * b;
}
JavaScript, PHP
@SarahKiniry
#STC16
// This uses the defined function.
multiply(3,2);
6
26. Creating Functions
# This is the format to define a function.
sub functionname {
code
}
Perl
@SarahKiniry
#STC16
27. Creating Functions
# This is the format to define a function.
sub functionname {
code
}
# This example defines a function.
sub dothingstovars {
$variables = @_;
do_something($variables);
return $variables;
}
Perl
@SarahKiniry
#STC16
28. Creating Functions
Perl
@SarahKiniry
#STC16
# This uses the defined function.
dothingstovars(“red”);
# This example defines a function.
sub dothingstovars {
$variables = @_;
do_something($variables);
return $variables;
}
# This is the format to define a function.
sub functionname {
code
}
29. Creating Functions
Perl
@SarahKiniry
#STC16
# This uses the defined function.
dothingstovars(“red”);
# This example defines a function.
sub dothingstovars {
$variables = @_;
do_something($variables);
return $variables;
}
# This is the format to define a function.
sub functionname {
code
}
blue
30. Creating Functions
# This is the format to define a function.
def functionname(parameters)
code
end
Ruby
@SarahKiniry
#STC16
31. Creating Functions
# This is the format to define a function.
def functionname(parameters)
code
end
# This example defines a function.
def Texas(name)
var = "Howdy, " + name
return var
end
Ruby
@SarahKiniry
#STC16
32. Creating Functions
Ruby
@SarahKiniry
#STC16
# This uses the defined function.
Texas(Bob)
# This is the format to define a function.
def functionname(parameters)
code
end
# This example defines a function.
def Texas(name)
var = "Howdy, " + name
return var
end
33. Creating Functions
Ruby
@SarahKiniry
#STC16
# This uses the defined function.
Texas(Bob)
# This is the format to define a function.
def functionname(parameters)
code
end
# This example defines a function.
def Texas(name)
var = "Howdy, " + name
return var
end
Howdy,
Bob
34. Creating Functions
# This is the format to define a function.
def functionname(parameters):
code
return[value]
Python
@SarahKiniry
#STC16
35. Creating Functions
# This example defines a function.
def print_return(my_words)
print my_words
return[]
Python
@SarahKiniry
#STC16
# This is the format to define a function.
def functionname(parameters):
code
return[value]
36. Creating Functions
Python
@SarahKiniry
#STC16
# This uses the defined function.
print_return(“Hey everybody!")
# This example defines a function.
def print_return(my_words)
print my_words
return[]
# This is the format to define a function.
def functionname(parameters):
code
return[value]
37. Creating Functions
Python
@SarahKiniry
#STC16
# This uses the defined function.
print_return(“Hey everybody!")
# This example defines a function.
def print_return(my_words)
print my_words
return[]
# This is the format to define a function.
def functionname(parameters):
code
return[value]
Hey
everybody!
38. Variables
The names of stored values that code uses to
perform actions. This can mean strings (text),
numbers, or boolean values (true/false).
There are also methods of storing groups of values,
such as arrays or hashes.
43. The Hello World Story
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
44. The Hello World Story
1
2
3
What does the application do?
This application displays a message to the user.
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
45. The Hello World Story
1
2
3
What does the application do?
This application displays a message to the user.
What text will the user see?
The user will see the text “Hello World.”
Which files or settings?
@SarahKiniry
#STC16
46. The Hello World Story
1
2
3
What does the application do?
This application displays a message to the user.
What text will the user see?
The user will see the text “Hello World.”
Which files or settings?
No other files or settings are involved.
@SarahKiniry
#STC16
47. Hello, Java!
/* This is a Hello World script. */
class HelloWorldApp {
public static void main(String[] args)
{
// Display the string.
System.out.println("Hello World!");
}
}
@SarahKiniry
#STC16
48. Hello, Java!
/* This is a Hello World script. */
class HelloWorldApp {
public static void main(String[] args)
{
// Display the string.
System.out.println("Hello World!");
}
}
@SarahKiniry
#STC16
49. Hello, Java!
/* This is a Hello World script. */
class HelloWorldApp {
public static void main(String[] args)
{
// Display the string.
System.out.println("Hello World!");
}
}
@SarahKiniry
#STC16
65. Hello, Ruby!
#!/usr/bin/ruby -w
# First Perl, now Ruby? Shiny.
puts "Hello, world!"
=begin
Really though, who knew there were two
programming languages named after
gemstones, even if one is kind of
misspelled?
=end
@SarahKiniry
#STC16
66. Hello, Ruby!
#!/usr/bin/ruby -w
# First Perl, now Ruby? Shiny.
puts "Hello, world!"
=begin
Really though, who knew there were two
programming languages named after
gemstones, even if one is kind of
misspelled?
=end
67. Hello, Ruby!
#!/usr/bin/ruby -w
# First Perl, now Ruby? Shiny.
puts "Hello, world!"
=begin
Really though, who knew there were two
programming languages named after
gemstones, even if one is kind of
misspelled?
=end
68. Hello, Python!
# A lot of programming languages use
# hashes for their comment character.
print("Hello, World!")
""" But they tend to diverge when it comes
to multiline comments. """
@SarahKiniry
#STC16
69. Hello, Python!
# A lot of programming languages use
# hashes for their comment character.
print("Hello, World!")
""" But they tend to diverge when it comes
to multiline comments. """
70. Hello, Python!
# A lot of programming languages use
# hashes for their comment character.
print("Hello, World!")
""" But they tend to diverge when it comes
to multiline comments. """
72. More JavaScript
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
JavaScript code example from w3schools.com
@SarahKiniry
#STC16
73. More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
74. More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
75. More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
76. More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
77. More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
78. More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
79. What’s The Story?
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
80. What’s The Story?
1
2
3
What does the application do?
This application switches between two images.
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
81. What’s The Story?
1
2
3
What does the application do?
This application switches between two images.
What text will the user see?
“Javascript Can Change Images”
Which files or settings?
@SarahKiniry
#STC16
82. What’s The Story?
1
2
3
What does the application do?
This application switches between two images.
What text will the user see?
“Javascript Can Change Images”
Which files or settings?
pic_bulbon.gif and pic_bulboff.gif, width=100,
height=180
@SarahKiniry
#STC16