The document discusses the different types of variables in Ruby including global variables, instance variables, class variables, local variables, constants, pseudo-variables, and literals. It provides examples of how to declare and use each variable type in Ruby code. It also covers the basic data types like integers, floats, strings, arrays, hashes, and ranges that can be used as literals in Ruby.
Esoft Metro Campus - Diploma in Web Engineering - (Module II) Multimedia Technologies
(Template - Virtusa Corporate)
Contents:
What is a Database?
The Relational Data Model
Relationships
Normalization
Functional Dependency
Normal Forms
DBMS
What is MySQL?
PHP Connect to MySQL
Create a MySQL Database
Connect to Database
Close Database
Create a MySQL Table
Insert Data Into MySQL
Get Last ID
Insert Multiple Records
Prepared Statements
Select Data From MySQL
Update Data in MySQL
Delete Data From MySQL
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
Esoft Metro Campus - Certificate in java basics
(Template - Virtusa Corporate)
Contents:
Structure of a program
Variables & Data types
Constants
Operators
Basic Input/output
Control Structures
Functions
Arrays
Character Sequences
Pointers and Dynamic Memory
Unions
Other Data Types
Input/output with files
Searching
Sorting
Introduction to data structures
Esoft Metro Campus - Diploma in Information Technology - (Module IX) Programming with C#.NET
(Template - Virtusa Corporate)
Contents:
Introduction to .NET Framework
.NET Framework Platform Architecture
Microsoft Visual Studio
C# Language
C#, VS and .NET Framework Versions
Your First C# Application
Printing Statements
Comments in C#
Common Type System
Value Types and Reference Type
Variables Declaration in C#
Type Conversion
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
Switch Statement
While Loop
Do While Loop
For Loop
Arrays
Accessing Arrays using foreach Loop
Two Dimensional Arrays
Classes and Objects in C#
Inheritance in C#
Partial Classes
Namespaces
Windows Forms Applications
Using Buttons, Labels and Text Boxes
Displaying Message Boxes
Error Handling with Try… Catch… finally…
Using Radio Buttons
Using Check Boxes
Using List Boxes
Creating Menus
Creating ToolStrips
MDI Forms
Database Application in C#
Creating a Simple Database Application
SQL Insert / Update / Retrieving / Delete
SQL Command Execute Methods
Data Sets
This document discusses data types and variables in JavaScript. It describes the main data types - integer, floating-point, boolean, and string. It explains that variables are used to store and manipulate data in memory, and have a name, type, and value. The document also covers declaring variables with the var keyword, assigning values to variables, and initializing variables before use.
Esoft Metro Campus - Diploma in Web Engineering - (Module VII) Advanced PHP Concepts
(Template - Virtusa Corporate)
Contents:
Arrays
Indexed Arrays
Associative Arrays
Multidimensional arrays
Array Functions
PHP Objects and Classes
Creating an Object
Properties of Objects
Object Methods
Constructors
Inheritance
Method overriding
PHP Strings
printf() Function
String Functions
PHP Date/Time Functions
time() Function
getdate() Function
date() Function
mktime() function
checkdate() function
PHP Form Handling
Collecting form data with PHP
GET vs POST
Data validation against malicious code
Required fields validation
Validating an E-mail address
PHP mail() Function
Using header() function to redirect user
File Upload
Processing the uploaded file
Check if File Already Exists
Limit File Size
Limit File Type
Check if image file is an actual image
Uploading File
Cookies
Sessions
C# programs use the .cs file extension and consist of namespaces, classes, and methods. A basic C# program defines a Main method within a class, where code is written. Classes can inherit from other classes and implement interfaces. The document provides an overview of basic C# concepts like data types, strings, enums, structures, and passing parameters by value and reference. It also demonstrates how to get input, write output, and use common .NET classes.
Ruby is a dynamic, open source object-oriented scripting language that is interpreted, not compiled. It supports features like garbage collection, exception handling, operator overloading, and just-in-time compilation. Ruby can be used for web development, system scripting, database programming, and GUI development. It uses classes and modules to support object-oriented programming concepts like inheritance, polymorphism, and mixins.
Introduction to ad-3.4, an automatic differentiation library in Haskellnebuta
This document provides an introduction to the ad-3.4 automatic differentiation library in Haskell. It summarizes the key capabilities of the library including differentiating arbitrary mathematical functions, calculating gradients, Jacobians and Hessians. It also provides examples of how to use the library to differentiate single variable scalar functions, calculate gradients, perform Taylor expansions, and check equality of functions. The document discusses some of the core classes and types in the library like Mode, Lifted and AD that enable automatic differentiation. It points to resources that explain the mechanism of automatic differentiation and package structure.
Esoft Metro Campus - Diploma in Web Engineering - (Module II) Multimedia Technologies
(Template - Virtusa Corporate)
Contents:
What is a Database?
The Relational Data Model
Relationships
Normalization
Functional Dependency
Normal Forms
DBMS
What is MySQL?
PHP Connect to MySQL
Create a MySQL Database
Connect to Database
Close Database
Create a MySQL Table
Insert Data Into MySQL
Get Last ID
Insert Multiple Records
Prepared Statements
Select Data From MySQL
Update Data in MySQL
Delete Data From MySQL
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
Esoft Metro Campus - Certificate in java basics
(Template - Virtusa Corporate)
Contents:
Structure of a program
Variables & Data types
Constants
Operators
Basic Input/output
Control Structures
Functions
Arrays
Character Sequences
Pointers and Dynamic Memory
Unions
Other Data Types
Input/output with files
Searching
Sorting
Introduction to data structures
Esoft Metro Campus - Diploma in Information Technology - (Module IX) Programming with C#.NET
(Template - Virtusa Corporate)
Contents:
Introduction to .NET Framework
.NET Framework Platform Architecture
Microsoft Visual Studio
C# Language
C#, VS and .NET Framework Versions
Your First C# Application
Printing Statements
Comments in C#
Common Type System
Value Types and Reference Type
Variables Declaration in C#
Type Conversion
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
Switch Statement
While Loop
Do While Loop
For Loop
Arrays
Accessing Arrays using foreach Loop
Two Dimensional Arrays
Classes and Objects in C#
Inheritance in C#
Partial Classes
Namespaces
Windows Forms Applications
Using Buttons, Labels and Text Boxes
Displaying Message Boxes
Error Handling with Try… Catch… finally…
Using Radio Buttons
Using Check Boxes
Using List Boxes
Creating Menus
Creating ToolStrips
MDI Forms
Database Application in C#
Creating a Simple Database Application
SQL Insert / Update / Retrieving / Delete
SQL Command Execute Methods
Data Sets
This document discusses data types and variables in JavaScript. It describes the main data types - integer, floating-point, boolean, and string. It explains that variables are used to store and manipulate data in memory, and have a name, type, and value. The document also covers declaring variables with the var keyword, assigning values to variables, and initializing variables before use.
Esoft Metro Campus - Diploma in Web Engineering - (Module VII) Advanced PHP Concepts
(Template - Virtusa Corporate)
Contents:
Arrays
Indexed Arrays
Associative Arrays
Multidimensional arrays
Array Functions
PHP Objects and Classes
Creating an Object
Properties of Objects
Object Methods
Constructors
Inheritance
Method overriding
PHP Strings
printf() Function
String Functions
PHP Date/Time Functions
time() Function
getdate() Function
date() Function
mktime() function
checkdate() function
PHP Form Handling
Collecting form data with PHP
GET vs POST
Data validation against malicious code
Required fields validation
Validating an E-mail address
PHP mail() Function
Using header() function to redirect user
File Upload
Processing the uploaded file
Check if File Already Exists
Limit File Size
Limit File Type
Check if image file is an actual image
Uploading File
Cookies
Sessions
C# programs use the .cs file extension and consist of namespaces, classes, and methods. A basic C# program defines a Main method within a class, where code is written. Classes can inherit from other classes and implement interfaces. The document provides an overview of basic C# concepts like data types, strings, enums, structures, and passing parameters by value and reference. It also demonstrates how to get input, write output, and use common .NET classes.
Ruby is a dynamic, open source object-oriented scripting language that is interpreted, not compiled. It supports features like garbage collection, exception handling, operator overloading, and just-in-time compilation. Ruby can be used for web development, system scripting, database programming, and GUI development. It uses classes and modules to support object-oriented programming concepts like inheritance, polymorphism, and mixins.
Introduction to ad-3.4, an automatic differentiation library in Haskellnebuta
This document provides an introduction to the ad-3.4 automatic differentiation library in Haskell. It summarizes the key capabilities of the library including differentiating arbitrary mathematical functions, calculating gradients, Jacobians and Hessians. It also provides examples of how to use the library to differentiate single variable scalar functions, calculate gradients, perform Taylor expansions, and check equality of functions. The document discusses some of the core classes and types in the library like Mode, Lifted and AD that enable automatic differentiation. It points to resources that explain the mechanism of automatic differentiation and package structure.
ESOFT Metro Campus - Diploma in Software Engineering - (Module V) Windows Based Application Development in C#
(Template - Virtusa Corporate)
Contents:
Introduction to .NET Framework
.NET Framework Platform Architecture
Microsoft Visual Studio
C# Language
C#, VS and .NET Framework Versions
Your First C# Application
Printing Statements
Comments in C#
Common Type System
Value Types and Reference Type
Variables Declaration in C#
Type Conversion
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
Switch Statement
While Loop
Do While Loop
For Loop
Arrays
Accessing Arrays using foreach Loop
Two Dimensional Arrays
Classes and Objects in C#
Inheritance in C#
Partial Classes
Namespaces
Windows Forms Applications
Using Buttons, Labels and Text Boxes
Displaying Message Boxes
Error Handling with Try… Catch… finally…
Using Radio Buttons
Using Check Boxes
Using List Boxes
Creating Menus
Creating ToolStrips
MDI Forms
Database Application in C#
Creating a Simple Database Application
SQL Insert / Update / Retrieving / Delete
SQL Command Execute Methods
Data Sets
ESOFT Metro Campus - Diploma in Software Engineering - (Module VI) Windows Based Application Development in Java
(Template - Virtusa Corporate)
Contents:
Introduction to Java
Features of Java
What you can create by Java?
Start Java Programming
Creating First Java Program
Java Virtual Machine
Basic Rules to Remember
Keywords in Java
Comments in Java Programs
Printing Statements
Primitive Data Types in Java
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
While Loop
Do While Loop
For Loop
Reading User Input
Arrays
Two Dimensional Arrays
Strings
Objects and Classes
Java Classes
Java Objects
Methods with Return Value
Methods without Return Value
Constructors
Method Overloading
Variable Types
Inheritance
Method Overriding
Abstract Classes
Interfaces
Polymorphism
Packages
Access Modifiers
Encapsulation
Exceptions
JDBC
GUI Applications with Swing
NetBeans IDE
C# is a functional programming language that has incorporated many features from functional languages like ML and Haskell over time. C# 3.0 in particular adds lambda expressions, type inference, and other features that bring it closer to functional languages while still maintaining its object-oriented roots. However, it lacks some advanced functional capabilities like datatypes and pattern matching, and iterator performance can be worse than lazy evaluation in pure functional languages.
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Chris Adamson
The document provides an overview of the C programming language. It begins by explaining that Objective-C extends standard ANSI C with object-oriented capabilities. It then discusses why C remains important today due to its use in libraries, operating systems, and as the base for many other popular languages. The document proceeds to cover basic C concepts like variables, data types, functions, flow control, pointers, memory allocation, and I/O parameters. It emphasizes that C provides high performance with a minimal footprint while abstracting away the CPU and memory.
This document summarizes key concepts in Ruby including variables, data types, operators, and expressions. It discusses global, instance, and class variables. It also covers local variables, constants, and pseudo-variables. The document explains string concatenation and interpolation. It provides details on arithmetic, comparison, boolean, and ternary operators. It also discusses ranges and the associativity of operators.
This document provides an overview of JavaFX and its key features:
- JavaFX is a platform for creating rich internet applications that can run across desktops, browsers, and mobile devices using a unified development model.
- It allows developers to build visually engaging experiences and distribute them broadly thanks to Java's widespread adoption across billions of devices.
- JavaFX aims to streamline the designer-developer workflow by shortening the production cycle for design and development.
- Examples of applications that can be built with JavaFX include 3D displays, video players, and applications with interactive 3D effects.
This document provides the specification for the Decaf programming language that will be used in a compiler course project. Decaf is an object-oriented language similar to C++ and Java, but with a simplified feature set to make the compiler projects manageable. The specification defines Decaf's lexical elements, keywords, types, variables, arrays, scoping rules, and grammar. Key points are that Decaf supports classes, interfaces, inheritance, and dynamic memory allocation using NewArray.
The document discusses input and output functions in C language like getchar, putchar, scanf, printf, gets and puts. It explains that these functions allow transfer of data between computer and standard input/output devices. Specifically, it describes the getchar and putchar functions for single character input/output, and the scanf and printf functions for transferring various data types including integers, floats and strings. It also briefly explains the gets and puts functions for string input/output.
The document provides an outline of topics for a C/C++ tutorial, including a "Hello World" program, data types, variables, operators, conditionals, loops, arrays, strings, functions, pointers, command-line arguments, data structures, and memory allocation. It gives examples and explanations of key concepts in C/C++ programming.
Python is a dynamically typed, object-oriented programming language. It uses indentation to delimit blocks rather than curly braces. Key features include strong typing, dynamic typing, support for functions, exceptions, classes, inheritance and modules. Common data types include lists, dictionaries, tuples and strings. Control flow is implemented with conditional statements and loops. Functions can return multiple values using tuples. Object-oriented features include classes and inheritance. Exceptions are handled using try-except blocks. External libraries are imported using the import statement.
This document provides an overview of C++ programming concepts across multiple pages. It begins with introductions to fundamental C++ concepts like header files, compiling and linking processes, variables and data types. It then covers expressions, selection statements, loops, arrays, functions, function overloading, structures and unions. The document is intended to serve as a roadmap for learning C++.
Esoft Metro Campus - Programming with C++
(Template - Virtusa Corporate)
Contents:
Overview of C++ Language
C++ Program Structure
C++ Basic Syntax
Primitive Built-in types in C++
Variable types
typedef Declarations
Enumerated Types
Variable Scope
Constants/Literals
Storage Classes
Operators
Control Constructs
Functions
Math Operations in C++
Arrays
Multi-dimensional Arrays
Strings
C++ Pointers
References
Date and Time
Structures
Basic Input / Output
Classes and Objects
Inheritance
Overloading
Polymorphism
Interfaces
Files and Streams
Exception Handling
Dynamic Memory
Namespaces
Templates
Preprocessor
Multithreading
This document provides an overview of C# data types, operators, expressions, statements, and other fundamental concepts. It discusses the different primitive data types in C#, including integer, floating-point, boolean, character, and string types. It also covers literals, variables, operators such as arithmetic, logical, comparison, and assignment, and shows examples of using each concept. The document is intended to teach basic C# syntax and semantics.
The document provides an overview of C# program structure including comments, identifiers, classes, methods, data types, variables, and input/output. Some key points:
- C# uses single-line and multi-line comments for documentation.
- Identifiers name variables, classes, and methods using letters, digits and underscores with case sensitivity.
- A class contains methods and defines the structure of an object. The Main method is entry point for console apps.
- Built-in data types include integers, floats, decimals, booleans, characters and strings.
- Variables store values of a specific data type and are declared with type and name. Constants are similar but values cannot change.
- Console
Swift is the latest new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. This presentation is all about Closures, Structures, Enum, Memory Management & Extensions.
Qcon2011 functions rockpresentation_f_sharpMichael Stal
This document provides an overview of functional programming concepts and introduces the F# programming language. It discusses core FP topics like immutable values, recursion, and higher-order functions. It then presents an introduction to F#, explaining that it combines object-oriented and functional programming. The document provides examples of basic F# syntax like functions, pattern matching, and the type system. It also illustrates concepts like currying, lazy evaluation, and the pipeline operator.
This document discusses several proposed new features for C++ including variadic templates, concepts, and other ideas. Variadic templates allow a template parameter pack that accepts a variable number of arguments. Concepts allow specifying constraints on template parameters to improve compiler errors. Other proposals include coroutines, static_if for conditional compilation, and transactional memory support. Overall the document outlines many ideas to enhance C++ templates and generic programming.
This document provides an overview of the Ruby programming language. It discusses that Ruby is an object-oriented scripting language created by Yukihiro Matsumoto, and can run on various platforms like Windows, Mac OS, and UNIX. It also summarizes key Ruby concepts like Interactive Ruby Shell (IRb), syntax, data types, variables, and predefined variables.
Ranges in Ruby can represent sequences, conditions, and intervals. Ranges use the ".." and "..." operators to define inclusive and exclusive sequences. Ranges can iterate over their values, test membership, find minimum/maximum values, and reject values. Ranges are also used as conditional expressions to check if a value falls within the start and end points, and in case statements to check different ranges.
ESOFT Metro Campus - Diploma in Software Engineering - (Module V) Windows Based Application Development in C#
(Template - Virtusa Corporate)
Contents:
Introduction to .NET Framework
.NET Framework Platform Architecture
Microsoft Visual Studio
C# Language
C#, VS and .NET Framework Versions
Your First C# Application
Printing Statements
Comments in C#
Common Type System
Value Types and Reference Type
Variables Declaration in C#
Type Conversion
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
Switch Statement
While Loop
Do While Loop
For Loop
Arrays
Accessing Arrays using foreach Loop
Two Dimensional Arrays
Classes and Objects in C#
Inheritance in C#
Partial Classes
Namespaces
Windows Forms Applications
Using Buttons, Labels and Text Boxes
Displaying Message Boxes
Error Handling with Try… Catch… finally…
Using Radio Buttons
Using Check Boxes
Using List Boxes
Creating Menus
Creating ToolStrips
MDI Forms
Database Application in C#
Creating a Simple Database Application
SQL Insert / Update / Retrieving / Delete
SQL Command Execute Methods
Data Sets
ESOFT Metro Campus - Diploma in Software Engineering - (Module VI) Windows Based Application Development in Java
(Template - Virtusa Corporate)
Contents:
Introduction to Java
Features of Java
What you can create by Java?
Start Java Programming
Creating First Java Program
Java Virtual Machine
Basic Rules to Remember
Keywords in Java
Comments in Java Programs
Printing Statements
Primitive Data Types in Java
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
While Loop
Do While Loop
For Loop
Reading User Input
Arrays
Two Dimensional Arrays
Strings
Objects and Classes
Java Classes
Java Objects
Methods with Return Value
Methods without Return Value
Constructors
Method Overloading
Variable Types
Inheritance
Method Overriding
Abstract Classes
Interfaces
Polymorphism
Packages
Access Modifiers
Encapsulation
Exceptions
JDBC
GUI Applications with Swing
NetBeans IDE
C# is a functional programming language that has incorporated many features from functional languages like ML and Haskell over time. C# 3.0 in particular adds lambda expressions, type inference, and other features that bring it closer to functional languages while still maintaining its object-oriented roots. However, it lacks some advanced functional capabilities like datatypes and pattern matching, and iterator performance can be worse than lazy evaluation in pure functional languages.
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Chris Adamson
The document provides an overview of the C programming language. It begins by explaining that Objective-C extends standard ANSI C with object-oriented capabilities. It then discusses why C remains important today due to its use in libraries, operating systems, and as the base for many other popular languages. The document proceeds to cover basic C concepts like variables, data types, functions, flow control, pointers, memory allocation, and I/O parameters. It emphasizes that C provides high performance with a minimal footprint while abstracting away the CPU and memory.
This document summarizes key concepts in Ruby including variables, data types, operators, and expressions. It discusses global, instance, and class variables. It also covers local variables, constants, and pseudo-variables. The document explains string concatenation and interpolation. It provides details on arithmetic, comparison, boolean, and ternary operators. It also discusses ranges and the associativity of operators.
This document provides an overview of JavaFX and its key features:
- JavaFX is a platform for creating rich internet applications that can run across desktops, browsers, and mobile devices using a unified development model.
- It allows developers to build visually engaging experiences and distribute them broadly thanks to Java's widespread adoption across billions of devices.
- JavaFX aims to streamline the designer-developer workflow by shortening the production cycle for design and development.
- Examples of applications that can be built with JavaFX include 3D displays, video players, and applications with interactive 3D effects.
This document provides the specification for the Decaf programming language that will be used in a compiler course project. Decaf is an object-oriented language similar to C++ and Java, but with a simplified feature set to make the compiler projects manageable. The specification defines Decaf's lexical elements, keywords, types, variables, arrays, scoping rules, and grammar. Key points are that Decaf supports classes, interfaces, inheritance, and dynamic memory allocation using NewArray.
The document discusses input and output functions in C language like getchar, putchar, scanf, printf, gets and puts. It explains that these functions allow transfer of data between computer and standard input/output devices. Specifically, it describes the getchar and putchar functions for single character input/output, and the scanf and printf functions for transferring various data types including integers, floats and strings. It also briefly explains the gets and puts functions for string input/output.
The document provides an outline of topics for a C/C++ tutorial, including a "Hello World" program, data types, variables, operators, conditionals, loops, arrays, strings, functions, pointers, command-line arguments, data structures, and memory allocation. It gives examples and explanations of key concepts in C/C++ programming.
Python is a dynamically typed, object-oriented programming language. It uses indentation to delimit blocks rather than curly braces. Key features include strong typing, dynamic typing, support for functions, exceptions, classes, inheritance and modules. Common data types include lists, dictionaries, tuples and strings. Control flow is implemented with conditional statements and loops. Functions can return multiple values using tuples. Object-oriented features include classes and inheritance. Exceptions are handled using try-except blocks. External libraries are imported using the import statement.
This document provides an overview of C++ programming concepts across multiple pages. It begins with introductions to fundamental C++ concepts like header files, compiling and linking processes, variables and data types. It then covers expressions, selection statements, loops, arrays, functions, function overloading, structures and unions. The document is intended to serve as a roadmap for learning C++.
Esoft Metro Campus - Programming with C++
(Template - Virtusa Corporate)
Contents:
Overview of C++ Language
C++ Program Structure
C++ Basic Syntax
Primitive Built-in types in C++
Variable types
typedef Declarations
Enumerated Types
Variable Scope
Constants/Literals
Storage Classes
Operators
Control Constructs
Functions
Math Operations in C++
Arrays
Multi-dimensional Arrays
Strings
C++ Pointers
References
Date and Time
Structures
Basic Input / Output
Classes and Objects
Inheritance
Overloading
Polymorphism
Interfaces
Files and Streams
Exception Handling
Dynamic Memory
Namespaces
Templates
Preprocessor
Multithreading
This document provides an overview of C# data types, operators, expressions, statements, and other fundamental concepts. It discusses the different primitive data types in C#, including integer, floating-point, boolean, character, and string types. It also covers literals, variables, operators such as arithmetic, logical, comparison, and assignment, and shows examples of using each concept. The document is intended to teach basic C# syntax and semantics.
The document provides an overview of C# program structure including comments, identifiers, classes, methods, data types, variables, and input/output. Some key points:
- C# uses single-line and multi-line comments for documentation.
- Identifiers name variables, classes, and methods using letters, digits and underscores with case sensitivity.
- A class contains methods and defines the structure of an object. The Main method is entry point for console apps.
- Built-in data types include integers, floats, decimals, booleans, characters and strings.
- Variables store values of a specific data type and are declared with type and name. Constants are similar but values cannot change.
- Console
Swift is the latest new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. This presentation is all about Closures, Structures, Enum, Memory Management & Extensions.
Qcon2011 functions rockpresentation_f_sharpMichael Stal
This document provides an overview of functional programming concepts and introduces the F# programming language. It discusses core FP topics like immutable values, recursion, and higher-order functions. It then presents an introduction to F#, explaining that it combines object-oriented and functional programming. The document provides examples of basic F# syntax like functions, pattern matching, and the type system. It also illustrates concepts like currying, lazy evaluation, and the pipeline operator.
This document discusses several proposed new features for C++ including variadic templates, concepts, and other ideas. Variadic templates allow a template parameter pack that accepts a variable number of arguments. Concepts allow specifying constraints on template parameters to improve compiler errors. Other proposals include coroutines, static_if for conditional compilation, and transactional memory support. Overall the document outlines many ideas to enhance C++ templates and generic programming.
This document provides an overview of the Ruby programming language. It discusses that Ruby is an object-oriented scripting language created by Yukihiro Matsumoto, and can run on various platforms like Windows, Mac OS, and UNIX. It also summarizes key Ruby concepts like Interactive Ruby Shell (IRb), syntax, data types, variables, and predefined variables.
Ranges in Ruby can represent sequences, conditions, and intervals. Ranges use the ".." and "..." operators to define inclusive and exclusive sequences. Ranges can iterate over their values, test membership, find minimum/maximum values, and reject values. Ranges are also used as conditional expressions to check if a value falls within the start and end points, and in case statements to check different ranges.
This document discusses how to write Ruby extensions using the Crystal programming language. Crystal compiles to efficient native code and has static typing like C, but with a Ruby-like syntax. The document explains how to define Crystal classes and methods, bind them to Ruby using C bindings, and compile the extension so it can be required from Ruby. Key points covered include declaring modules and functions in a C library, converting between Ruby and Crystal types, defining Ruby classes and methods from Crystal, and initializing the extension so it integrates with Ruby. The goal is to leverage Crystal's performance while still writing code in a Ruby-like way using the same interfaces as a C extension.
Ruby is a dynamic, open source programming language that was created in 1993 by Yukihiro Matsumoto who wanted to ensure that programming is simple, practical and enjoyable. It combines object-oriented and imperative programming and provides automatic memory management. Some key aspects of Ruby include being dynamically typed, following the principle of least surprise, and being multi-paradigm supporting object-oriented, functional and imperative programming.
This document discusses Ruby data types including numbers, text, arrays, hashes, ranges, symbols, and objects. It provides details on integer and float numbers, strings, string operations, arrays and common array methods, hashes and hash syntax, ranges and how they work, symbols and how they differ from strings, and Ruby objects and operations like equal?, conversions and tainting objects.
The document provides an overview of the Ruby programming language, including its goals, contents, key features like object oriented programming and metaprogramming. It covers Ruby statements, data types, classes, modules, inheritance, exceptions handling, and how to dynamically modify classes and objects through metaprogramming.
This document provides an introduction and overview of key JavaScript concepts including data types, variables, objects, functions, and arrays. It discusses JavaScript's case sensitivity, optional semicolons, and comment syntax. It also covers numeric, string, boolean, and null/undefined data types as well as objects, functions, and arrays. Special values, operators, and methods are defined for working with each data type.
This document provides an overview of basic concepts in VB.NET, including variables, data types, constants, arrays, operators, flow control statements, and more. It defines variables as storage locations for values, and describes how to declare different data types like numeric, string, boolean, and object. Constants and enums are introduced as fixed values that cannot change. Arrays are defined as lists that allow storing multiple values of the same type. Common operators for arithmetic, comparison, logical operations and assignments are outlined. Decision making statements like If/Then and Select Case as well as looping constructs such as For, For Each, and Do loops are briefly explained.
This document provides information about various data types in Ruby including numbers, text, arrays, hashes, and more. It discusses how numbers can be integers, floats, complexes, big decimals, and rationals. It also covers string literals and interpolation, character literals, and various string operators and methods. Arrays and hashes are introduced as mutable collections that can hold heterogeneous data and are accessed via indexes.
In this presentation, I covered the following topics:
1. Introduction to Ruby
2. Variables
3. Datatypes
4. Decision-making Statements
5. Looping Statements
6. Simple I/O
7. Array and its methods
8. Hashes and its methods
9. Class and Object
10. Iterators
- JavaScript was created in 1995 by Brandon Eich and was originally called LiveScript. It was renamed to JavaScript to capitalize on the popularity of Java, though the two languages are unrelated.
- JavaScript is an interpreted, prototype-based scripting language that is commonly used for client-side web development but can also be used for server-side applications and other programs. It has dynamic typing and supports functions as first-class objects.
- The document discusses JavaScript syntax including variables, numbers, strings, comments, control flow statements like if/else and loops, and functions. It also covers the Rhino runtime environment for running JavaScript without a browser.
This document provides an overview of JavaScript development challenges and how EcmaScript 2015 and TypeScript address these challenges. It discusses the rise of JavaScript, traditional development challenges like lack of structuring capabilities and static types, new features in EcmaScript 2015 like arrow functions and classes, and how TypeScript adds static types and interfaces to provide benefits for large application development. The document contains code examples to demonstrate various JavaScript and TypeScript language features.
The document discusses C++ scope resolution operator (::) and pointers. It explains that :: is used to qualify hidden names and access variables or functions in the global namespace when a local variable hides it. It also discusses pointers, which are variables that store memory addresses. Pointers allow dynamic memory allocation and are useful for passing arguments by reference. Key pointer concepts covered include null pointers, pointer arithmetic, relationships between pointers and arrays, arrays of pointers, pointer to pointers, and passing/returning pointers in functions.
The document discusses Ruby classes and objects. It defines a class as a blueprint from which individual objects are created. A class contains data members like attributes and functions/methods. Objects are instances of a class and are created using the new method. The document provides examples of defining a Vehicle class with attributes like wheels, horsepower etc. and methods like speeding, driving. It also discusses creating Customer objects, initializing them using an initialize method, and calling their methods.
This document provides an overview of JavaScript, including its uses, syntax, data types, operators, and objects. JavaScript is an object-based scripting language used to program the behavior of web pages. It allows for client-side validation, dynamic drop-down menus, displaying data and time, and other interactive effects. JavaScript code can be embedded directly in HTML using <script> tags or linked externally. The core data types include numbers, strings, Booleans, arrays, and objects. Objects are similar to arrays but use named indexes instead of numbered indexes. Key JavaScript concepts covered include variables, literals, functions, conditionals, and more.
The document provides five rules for presenting code in slides: 1) Use a monospaced font for readability, 2) Use large fonts that are visible from the back of the room, 3) Only highlight syntax where needed to avoid walls of text, 4) Use ellipses (...) to remove unnecessary code, and 5) Add annotations to draw attention to specific parts of the code. It then demonstrates these rules by presenting an example of using promises in JavaScript to avoid nested callbacks.
What is the general format for a Try-Catch block Assume that amt l .docxajoy21
The document discusses command line arguments in C/C++ programs. It explains that command line arguments allow providing input to a program through command line instead of user input. The main() function needs to be defined as int main(int argc, char *argv[]) to access command line arguments. The argc parameter indicates number of arguments, while argv is an array containing the arguments as strings. Functions like atoi() and atof() are used to convert argument strings to int and double as arguments are received as char* by default. Examples demonstrate how to iterate through argv and access individual arguments.
The document discusses Ruby file input/output (I/O) and directory functionality. It covers Ruby classes like IO, File, and Dir that provide methods for reading, writing, opening, closing, renaming, and deleting files. It also discusses creating and navigating directories. Some key file I/O methods include read, write, gets, puts, readline, sysread, and syswrite. Directory methods include chdir, pwd, entries, mkdir, and delete. The document provides examples of using these various Ruby file and directory functions.
This document discusses two Ruby iterators: each and collect. The each iterator returns each element of an array or hash and executes a block of code for each. Collect returns a new array containing the return values of its block for each element or just returns the original collection. Examples demonstrate using each to print array elements and collect to multiply array elements by 10 and return a new array.
This document discusses working with dates and times in Ruby. It provides examples of getting the current date and time, extracting components of dates and times like year, month, day, and formatting dates and times in different formats. It also covers time arithmetic, timezones, and daylight savings time.
Hashes in Ruby are collections of key-value pairs similar to arrays but where indexing is done using keys of any object type rather than integers. Keys and values can be any object including arrays. Hashes have many built-in methods for accessing, modifying, and traversing key-value pairs including fetch, delete, each, keys, values, merge, and more. Creating a hash can be done using Hash.new or Hash[] and default values can be set.
Ruby arrays are ordered collections that can hold any object type. They are indexed starting at 0, can dynamically grow in size, and provide many built-in methods. Some key characteristics of Ruby arrays include:
1) They are ordered and associate each element with an integer index. Negative indices count backward from the end.
2) Arrays can be created and initialized in several ways such as with Array.new or [].
3) Arrays provide over 70 built-in methods for accessing, modifying, and manipulating array elements like fetch, push, pop, insert, delete, and more.
This document provides information about Ruby strings, including:
- Strings can be created using single or double quotes, and support escape characters
- Strings support expression interpolation using #{expression}
- Methods like gsub, slice, and split can be used to manipulate and extract parts of strings
- Built-in string methods allow tasks like changing case, formatting strings, searching/matching substrings
- Strings have methods for operations like concatenation, comparison, indexing, and conversion between other types
Ruby modules allow grouping of related methods and constants in a namespace to avoid naming collisions. Modules can be included in classes using the 'include' statement, providing a way for classes to inherit functionality from multiple modules, implementing a form of multiple inheritance known as a mixin. Modules define a namespace and methods are called using the module name and a period. The 'require' statement loads module files so their contents can be used.
Ruby allows defining reusable blocks of code that can be invoked from methods using the yield statement. A block consists of code enclosed in curly braces and is associated with a method of the same name. The yield statement passes control to the block and can optionally pass parameters to the block. Ruby files can also define BEGIN and END blocks to specify code to run as the file loads and after program execution completes, respectively.
Ruby methods are used to bundle repeatable statements into a single unit. Method names should begin with a lowercase letter. Methods should be defined before calling them. Methods can accept parameters with default values. Variables can be returned from methods. The return statement is used to return values explicitly. Methods can take a variable number of parameters using *. Class methods can be accessed without instantiating an object. The alias statement creates an alias for a method or variable. The undef statement cancels a method definition.
The document discusses various loop constructs in Ruby including while, until, for, break, next, redo, and retry. The while and until loops execute code repeatedly as long as or until a conditional is true. The for loop iterates over each element in an expression. break exits the current loop, next skips to the next iteration, redo restarts the current iteration, and retry restarts the entire loop from the beginning.
The document discusses different conditional statements in Ruby including if/else, unless, case. The if/else statement executes code based on whether a conditional is true or false. Unless executes code if the conditional is false. Case compares an expression to expressions in when clauses using === and executes matching code. Examples are provided for each statement.
Ruby supports single-line comments starting with # and multiline comments using =begin and =end. Single-line comments extend from # to the end of the line. Multiline comments can span multiple lines between =begin and =end tags. Trailing comments should be aligned and separated from code for clarity.
The document summarizes Ruby operators including arithmetic, comparison, assignment, logical, bitwise, range, ternary and defined? operators. It provides examples of common operators like addition, subtraction, logical AND, assignment, range inclusion and method definition checking. Operators in Ruby are generally method calls that allow succinct operation on operands.
The document discusses Ruby syntax including: writing a simple Ruby program with the .rb extension; whitespace and line endings in Ruby programs; Ruby identifiers, reserved words, and comments; here documents for multi-line strings; and the BEGIN and END statements for code execution before and after the main program. Key points are that whitespace is generally ignored, semicolons and newlines end statements, identifiers are case sensitive, reserved words can't be used as names, here documents use line terminators to build strings, and BEGIN and END blocks allow code execution at the start and end of a Ruby program.
This document provides an overview of setting up a Ruby development environment. It discusses installing Ruby on Unix and Windows systems, common command line options, important environment variables, popular Ruby editors like VIM and RubyWin, and how to use the Interactive Ruby shell (IRb) for testing code. The next step outlined is writing initial Ruby programs after confirming a working environment is established.
This document provides an overview and introduction to the Ruby programming language. Ruby is a scripting language designed by Yukihiro Matsumoto that can run on Windows, Mac OS, and UNIX systems. The tutorial is intended for beginners and assumes some basic knowledge of computer programming but no experience with Ruby is required. It provides links to additional reference materials on Ruby including quick references, lists of useful functions and tools, resources for learning Ruby, and tutorials for Ruby on Rails web development.
Ruby is a pure object-oriented programming language created in 1993 by Yukihiro Matsumoto. It has features similar to Smalltalk, Perl, and Python. Ruby is freely available, open-source, and easy to learn. It can be used to create web applications, CGI scripts, and programs that connect to databases. The next chapter will cover obtaining, installing, and setting up Ruby.
Ruby provides mechanisms like begin/rescue/ensure to handle exceptions gracefully. The begin block contains code that could raise exceptions, rescue clauses specify the types of exceptions to handle, and ensure ensures some code is always executed. Exceptions can be raised manually using raise and caught using catch/throw. Common exception classes include StandardError, while custom exceptions should inherit from Exception.
1. O documento é um tutorial de Ruby que ensina sobre a linguagem, incluindo como instalá-la, tipos básicos, estruturas de controle e iteradores.
2. É dividido em seções como instalação, tipos básicos, expressões regulares, arrays, hashes, tratamento de exceções e iteradores.
3. O tutorial é licenciado sob Creative Commons permitindo compartilhamento e modificações desde que creditado e não usado comercialmente.
2. def display_details()
puts "Customer id #@cust_id"
puts "Customer name #@cust_name"
puts "Customer address #@cust_addr"
end
end
# Create Objects
cust1=Customer.new("1", "John", "Wisdom Apartments, Ludhiya")
cust2=Customer.new("2", "Poul", "New Empire road, Khandala")
# Call Methods
cust1.display_details()
cust2.display_details()
Here @cust_id, @cust_name and @cust_addr are instance variables. This will produce following result:
Customer id 1
Customer name John
Customer address Wisdom Apartments, Ludhiya
Customer id 2
Customer name Poul
Customer address New Empire road, Khandala
Ruby Class Variables:
Class variables begin with @@ and must be initialized before they can be used in method definitions.
Referencing an uninitialized class variable produces an error. Class variables are shared among descendants of the class
or module in which the class variables are defined.
Overriding class variables produce warnings with the -w option.
Here is an example showing usage of class variable:
#!/usr/bin/ruby
class Customer
@@no_of_customers=0
def initialize(id, name, addr)
@cust_id=id
@cust_name=name
@cust_addr=addr
end
def display_details()
puts "Customer id #@cust_id"
puts "Customer name #@cust_name"
puts "Customer address #@cust_addr"
end
def total_no_of_customers()
@@no_of_customers += 1
puts "Total number of customers: #@@no_of_customers"
end
end
# Create Objects
cust1=Customer.new("1", "John", "Wisdom Apartments, Ludhiya")
cust2=Customer.new("2", "Poul", "New Empire road, Khandala")
# Call Methods
cust1.total_no_of_customers()
cust2.total_no_of_customers()
Here @@no_of_customers is a class variable. This will produce following result:
Total number of customers: 1
Total number of customers: 2
3. Ruby Local Variables:
Local variables begin with a lowercase letter or _. The scope of a local variable ranges from class, module, def, or do to
the corresponding end or from a block's opening brace to its close brace {}.
When an uninitialized local variable is referenced, it is interpreted as a call to a method that has no arguments.
Assignment to uninitialized local variables also serves as variable declaration. The variables start to exist until the end of
the current scope is reached. The lifetime of local variables is determined when Ruby parses the program.
In the above example local variables are id, name and addr.
Ruby Constants:
Constants begin with an uppercase letter. Constants defined within a class or module can be accessed from within that
class or module, and those defined outside a class or module can be accessed globally.
Constants may not be defined within methods. Referencing an uninitialized constant produces an error. Making an
assignment to a constant that is already initialized produces a warning.
#!/usr/bin/ruby
class Example
VAR1 = 100
VAR2 = 200
def show
puts "Value of first Constant is #{VAR1}"
puts "Value of second Constant is #{VAR2}"
end
end
# Create Objects
object=Example.new()
object.show
Here VAR1 and VAR2 are constant. This will produce following result:
Value of first Constant is 100
Value of second Constant is 200
Ruby Pseudo-Variables:
They are special variables that have the appearance of local variables but behave like constants. You can not assign any
value to these variables.
self: The receiver object of the current method.
true: Value representing true.
false: Value representing false.
nil: Value representing undefined.
__FILE__: The name of the current source file.
__LINE__: The current line number in the source file.
Ruby Basic Literals:
4. The rules Ruby uses for literals are simple and intuitive. This section explains all basic Ruby Literals.
Integer Numbers:
Ruby supports integer numbers. An integer number can range from -230 to 230-1 or -262 to 262-1. Integers with-in this
range are objects of class Fixnum and integers outside this range are stored in objects of class Bignum.
You write integers using an optional leading sign, an optional base indicator (0 for octal, 0x for hex, or 0b for binary),
followed by a string of digits in the appropriate base. Underscore characters are ignored in the digit string.
You can also get the integer value corresponding to an ASCII character or escape sequence by preceding it with a
question mark.
Example:
123 # Fixnum decimal
1_234 # Fixnum decimal with underline
-500 # Negative Fixnum
0377 # octal
0xff # hexadecimal
0b1011 # binary
?a # character code for 'a'
?n # code for a newline (0x0a)
12345678901234567890 # Bignum
NOTE: Class and Objects are explained in a separate chapter of this tutorial.
Floating Numbers:
Ruby supports integer numbers. They are also numbers but with decimals. Floating-point numbers are objects of class
Float and can be any of the following:
Example:
123.4 # floating point value
1.0e6 # scientific notation
4E20 # dot not required
4e+20 # sign before exponential
String Literals:
Ruby strings are simply sequences of 8-bit bytes and they are objects of class String. Double-quoted strings allow
substitution and backslash notation but single-quoted strings don't allow substitution and allow backslash notation only
for and '
Example:
#!/usr/bin/ruby -w
puts 'escape using ""';
puts 'That's right';
This will produce following result:
escape using ""
That's right
You can substitute the value of any Ruby expression into a string using the sequence #{ expr }. Here expr could be any
ruby expression.
5. #!/usr/bin/ruby -w
puts "Multiplication Value : #{24*60*60}";
This will produce following result:
Multiplication Value : 86400
Backslash Notations:
Following is the list of Backslash notations supported by Ruby:
Notation Character represented
n Newline (0x0a)
r Carriage return (0x0d)
f Formfeed (0x0c)
b Backspace (0x08)
a Bell (0x07)
e Escape (0x1b)
s Space (0x20)
nnn Octal notation (n being 0-7)
xnn Hexadecimal notation (n being 0-9, a-f, or A-F)
cx, C-x Control-x
M-x Meta-x (c | 0x80)
M-C-x Meta-Control-x
x Character x
For more detail on Ruby Strings, go through Ruby Strings.
Ruby Arrays:
Literals of Ruby Array are created by placing a comma-separated series of object references between square brackets. A
trailing comma is ignored.
Example:
#!/usr/bin/ruby
ary = [ "fred", 10, 3.14, "This is a string", "last element", ]
ary.each do |i|
puts i
end
6. This will produce following result:
fred
10
3.14
This is a string
last element
For more detail on Ruby Arrays, go through Ruby Arrays.
Ruby Hashes:
A literal Ruby Hash is created by placing a list of key/value pairs between braces, with either a comma or the sequence
=> between the key and the value. A trailing comma is ignored.
Example:
#!/usr/bin/ruby
hsh = colors = { "red" => 0xf00, "green" => 0x0f0, "blue" => 0x00f }
hsh.each do |key, value|
print key, " is ", value, "n"
end
This will produce following result:
green is 240
red is 3840
blue is 15
For more detail on Ruby Hashes, go through Ruby Hashes.
Ruby Ranges:
A Range represents an interval.a set of values with a start and an end. Ranges may be constructed using the s..e and s...e
literals, or with Range.new.
Ranges constructed using .. run from the start to the end inclusively. Those created using ... exclude the end value.
When used as an iterator, ranges return each value in the sequence.
A range (1..5) means it includes 1, 2, 3, 4, 5 values and a range (1...5) means it includes 1, 2, 3, 4 values.
Example:
#!/usr/bin/ruby
(10..15).each do |n|
print n, ' '
end
This will produce following result:
10 11 12 13 14 15
For more detail on Ruby Ranges, go through Ruby Ranges.