Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl

Size: px
Start display at page:

Download "Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl"

Transcription

1 First CGI Script and Perl Perl in a nutshell Prof. Rasley shebang line tells the operating system where the Perl interpreter is located necessary on UNIX comment line ignored by the Perl interpreter End statements with semicolon newline character to end a line and create a new line First CGI Script and Perl Content type header tells the script what type of output there will be print Content type: html/text\n\n ; print is used to output information within the quotation marks to the browser HTML tags are created dynamically using print statements When you run a program, be sure to change the permissions to 755 as with PHP Creating a Link to a Script When creating a script, remember to: Enter the shebang line (required for UNIX) Enter a comment that includes the name of the script and the script s purpose Enter the Content type line: print Content type: text/html\n\n ; print Function Perl can generate HTML output in various ways: print printf here documents Syntax for print: print output; Output can be strings, functions, variables Output can be an expression or a list of expressions, separated by commas Parsing Data To use CGI.pm, you need to include the statement: use CGI qw(:standard); qw = quote words Same as the statement use CGI( :standard ); :standard is an import tag Tells the Perl interpreter to allow the use of the standard features of the CGI.pm module Can find out more about CGI.pm, by typing: perldoc CGI.pm 1

2 Parsing Data The param function accesses the value associated with a key param is part of the standard features of CGI.pm param(key) where key is in single or double quotation marks param( state ); param( state ); Parsing Data If the offline mode message does not appear, the use CGI statement needs to be changed: use CGI qw(:standard debug); This is including the debug pragma, and tells CGI.pm to pause to let you type in the data pragma = special type of Perl module. Variables in Perl Variable Location in the computer s internal memory where a script can temporarily store data Each variable has a data type Determines the kind of data the variable can store Perl has 3 data types: Scalar variable can store one value» Example: number or string Array variable can store lists or sets of values Hash variable can store lists or sets of values Each variable has a name Variables in Perl Scalar variable naming: Must begin with dollar sign ($) Followed by a letter Optionally followed by one or more letters, numbers, or underscores Valid names: $city, $inc_tax Variable names are case sensitive: $city and $CITY are two different variables Should use descriptive names Variables in Perl Perl does not require variables to be explicitly declared By default, variables are created on the fly Variable exists as soon as you use the variable It is a good programming practice to not allow variables to be created on the fly use strict; Prevents Perl from creating undeclared variables Syntax to declare variables: my (variablelist); my ($hours, $gross, $sales); Accessing the Values Received from an Online Form Data sent using an online form must also be parsed by the script Can use same parsing routing in CGI.pm param function 2

3 The Bonus Calculator Form The <FORM> tag uses 2 properties: ACTION The name of the CGI script that will process the form data METHOD Controls how your web browser sends the form data to the Web server GET Default method Appends form data to the end of the URL Similar to sending data using a hyperlink POST Sends form data in a separate data stream Safer than GET» Some web servers limit the size of the URL The Bonus Calculator Form The Bonus Calculator Form Array Variables Array declaration syntax: my arrayname=(list); Name of array must begin with at sign (@) After the name must start with a letter, and then a combination of letters, numbers, or underscores The list consists of values separated by commas Array Variables Array declaration examples: = (25000, 35000, 10000); = ( Boston, Chicago, Detriot, San Diego ); Array Variables Accessing the array Replace in the array name with: a $, array name, and index enclosed in square brackets ([ ]) Example: = (25000, 35000, 10000); $sales[0]=25000 $sales[1]=35000 $sales[2]=10000 A scalar variable within an array can be used the same way as any other scalar variable 3

4 Using an Array This code now includes declaring array, as well as accessing and printing the corresponding model name Hash Variables Hash variable, or hash: Collection of related scalar variables Like an array variable Instead of using an index number, a hash uses a key name Like an array s index numbers, the keys are assigned to the scalar variables when the hash is created Another name for a hash is an associative array Hash Variables Hash declaration syntax: my hashname = (key1, value1, key2, value2,...keyn, valuen); Name of hash must start with percent sign (%) After %, the name must start with a letter, and then a combination of letters, numbers, or underscores Can declare the hash in one line, or multiple lines Hash Variables Hash declaration example #1: my %sales = ( Jan, 25000, Feb, 35000, Mar, 10000); Jan, Feb, and Mar are keys Their corresponding values are 25000, 35000, Hash Variables Hash declaration example #2: my %cities = ( 617, Boston, 312, Chicago, 313, Detroit, 619, San Diego ); Keys: 617, 312, 313, 619 Values: Boston, Chicago, Detroit, San Diego Hash Variables Accessing the hash: Replace the % in the hash name with a $, array name, key enclosed in braces ({ ) Example: my %sales = ( Jan, 25000, Feb, 35000, Mar, 10000); $sales{jan = $sales{feb = $sales{mar =

5 Hash Variables Accessing the hash: If a key has a space: Use single or double quotation marks within the braces $state { New Mexico $state { New Mexico A scalar variable within a hash can be used the same as any other scalar variable Using a Hash This code now includes declaring the %systems hash, and printing out the full operating system name by accessing the %systems hash The foreach and for Statements 3 basic structures (control or logic structures) make up scripts: Sequence Script statements are processed in the order they appear in the script Selection Make a decision or comparison, and then select one of 2 paths based on the result Repetition (loop) Repeat a block of instructions for a specified number of times or until a condition is met Examples: foreach, for, while, until The foreach and for Statements foreach: The foreach statement repeats one or more instructions per element in a group, like an array When each member of the array has been processed, the loop stops foreach element (group) { One or more statements processed per element in group The foreach and for Statements The foreach and for Statements foreach Example: = (5000, 200, 100, 3); foreach $num (@numbers) { print $num<br>\n ; Result: for: The for statement is used to repeat one or more statements as long as the loop condition is true 3 arguments are used: initialization argument counter variable loop condition Boolean expression that evaluates to true or false Loop stops when loop condition evaluates to false update Updates the counter variable in the initialization argument 5

6 The foreach and for Statements for: for (initialization; loop condition; update) { one or more statements to be processed as long as the loop condition is true Example: my $num; for ($num = 1; $num < 4; $num = $num + 1) { print $num<br>\n ; Result: Updating the Juniper Printers script foreach will be used to process each member of array Creating and Opening a File open function examples: Location of files to create or open if no path is used: UNIX same directory as script Windows default directory, typically cgi bin It is good practice to begin filehandle names with IN or OUT, depending on the filehandle is used while and until statements while statement: Used to repeat a block of instructions while a condition is true while (condition) { statement(s) to process while condition is true Example: = (5000, 200, 100, 3); $x = 0; while ($x < 4) { print $nums[$x]\n ; $x = $x + 1; Result: while and until statements until statement: Used to repeat a block of instructions until a condition becomes true until (condition) { statement(s) to process until condition is true Example: = (5000, 200, 100, 3); $x = 0; until ($x == 4) { print $nums[$x]\n ; $x = $x + 1; Result: Using the die function If the open function fails, by default, the script continues to run die function: Displays message and exits script if there is an error while accessing a file die message 6

7 Using the die function Writing Records to a File Can use print to write to the filehandle representing an open file print filehandle data\n; Typically, each record in a datafile is written to a separate line Writing Records to a File If a record contains more than 1 field, then a field separator (delimiter) is used: Examples: comma (,) colon (:) ampersand (&) tab (\t) pipe ( ) Field separator must not be part of the data in the fields Otherwise, when reading the data from the file, there will be problems confusing the separator in the data and the actual field separator Closing a File To make sure that no data is lost, any opened files should be closed before the script ends Syntax: close (filehandle); A file is automatically closed when the script ends, but it is good practice to close the file when finished using it Syntax: arrayname = <filehandle>; Reading Records into an Array More on foreach Reads records from a file into an array no matter how many records are in the file! <> = angle operator Angle operator instructs to read record from filehandle and store each in a scalar variable in = <INFILE>; Can declare the loop variable in the foreach statement The variable can be used within the loop, and will be removed from memory when the loop has completed running 7

8 Removing the Newline Character Chomp function can be used to remove the newline character (\n) from the end of a record Syntax: chomp (variable); chomp ($rec); Using the split function The split function can be used to divide a string of characters into separate parts based on a pattern Syntax: split (/pattern/, string); split (/,/, John,Jane ); Splits the string John,Jane into 2 parts John and Jane Using the split function The sort function sort function: temporarily sorts a list of values sort (list); Can be used to sort a comma separated list of values, array, or keys of a hash The keys and sort functions keys and sort can be used together, as in Example 3 sort function will alphabetize the keys in a hash Coding the Selection Structure in Perl if statement: Used for coding the selection structure if (condition) { one or more statements to be processed when the condition evaluates to true else { one or more statements to be processed when the condition evaluates to false 8

9 Comparison Operators Comparison operators are also called relational operators One set to compare numeric values One set to compare string values Each operator has a precedence value The order in which Perl performs the comparisons in an expression For example, comparisons with a precedence number of 1 will be performed before comparisons with a precedence of 2 Comparison Operators for Numeric Values Test for equality using 2 equal signs == Easy to confuse with the assignment operator (=) Comparison Operators for Numeric Values Comparison Operators for String Values When comparing 2 strings, the ASCII value of each character in the first string is compared to the corresponding character in the second string Capital letters have a lower ASCII value than their corresponding lowercase letters Comparison Operators for String Values Logical Operators and and or are the most commonly used logical operators Combine multiple conditions into one compound condition and: All conditions must be true for the compound condition to be true If the first condition is false, the second condition will not be evaluated or: Any condition must be true for the compound condition to be true 9

10 Validating Script Input Data Can choose to check for correct or incorrect values Adding Items to an Array The push function is used to add item(s) to the end of an array push (array, list); Examples: push Hawaii ); push 10, 25); Can also add items to the end of an array with an assignment statement Syntax: array = (array, = (@nums, 10, 25); Determining the Size of an Array There are 2 ways to determine the size of an array: Assign the name of an array to a scalar variable $size Now, $size will be equal to the number of scalar variables in the array The scalar function Syntax: scalar (array); print scalar (@errors); Will print the number of scalar variables in array Using the if/elsif/else Form of the if statement if/elsif/else structure can be used if there are multiple alternatives Can choose to use nested if statement(s) or use elsif for every alternative Using if/elsif/else Functions Function (or subroutine) Block of code that begins with keyword sub Code for a function can be in the same script or can be in a separate file Examples: Code for param is stored in CGI.pm file Code for push is stored in perl/perl.exe 10

11 Functions Code for a function is processed when the function is called or invoked Invoke a function by including its name and optional argument(s) in a statement $game = param ( Game ); param function is called and the argument is the Game key Functions Each function has a specific task After the function has completed, a value is returned to the statement that called it The statement does not have to use the return value of the function function: Functions function: function header: Begins with sub keyword, space, function name, space, opening brace ({) Same rules for naming functions as naming variables Variable names should be easy to understand function footer: Closing brace () return statement: Optional If there is no return statement, the function returns the value of the last statement it processes Can return multiple value(s) The function is terminated after the value(s) are returned The Dombrowski Company Script 2 calls to user defined functions: display_error_page(); display_acknowledgement(); If there are no arguments to pass to a function, following the function name is an empty set of parentheses. How do we get at the function is a special array that contains arguments passed to that function For example, if one argument is passed, can access it with $_[0] Perl creates this array automatically for us when we define functions The exit; statement exit; terminates the script Stops the script from processing further instructions Not required, but a good programming practice The script will terminate after the statements have completed 11

12 The Scope of variables Environment Variables If a variable is declared within a function, it is only available to that function Many programmers consider it poor programming to have a function assign values to variables declared in the main part of the script More difficult to debug and troubleshoot Series of hidden keys and values that the Web server sends to a CGI script when the script is run Can find out more information about the web server, user, and the user s browser through environment variables Stored in the %ENV hash Environment Variables 12

?<BACBC;@@A=2(?@?;@=2:;:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

?<BACBC;@@A=2(?@?;@=2:;:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NGS data format NGS data format @SRR031028.1708655 GGATGATGGATGGATAGATAGATGAAGAGATGGATGGATGGGTGGGTGGTATGCAGCATACCTGAAGTGC BBBCB=ABBB@BA=?BABBBBA??B@BAAA>ABB;@5=@@@?8@:==99:465727:;41'.9>;933!4 @SRR031028.843803

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

7 Why Use Perl for CGI?

7 Why Use Perl for CGI? 7 Why Use Perl for CGI? Perl is the de facto standard for CGI programming for a number of reasons, but perhaps the most important are: Socket Support: Perl makes it easy to create programs that interface

More information

CGI Programming. What is CGI?

CGI Programming. What is CGI? CGI Programming What is CGI? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost any language can produce CGI programs even C++ (gasp!!)

More information

Exercise 1: Python Language Basics

Exercise 1: Python Language Basics Exercise 1: Python Language Basics In this exercise we will cover the basic principles of the Python language. All languages have a standard set of functionality including the ability to comment code,

More information

PHP Debugging. Draft: March 19, 2013 2013 Christopher Vickery

PHP Debugging. Draft: March 19, 2013 2013 Christopher Vickery PHP Debugging Draft: March 19, 2013 2013 Christopher Vickery Introduction Debugging is the art of locating errors in your code. There are three types of errors to deal with: 1. Syntax errors: When code

More information

C HAPTER E IGHTEEN T HE PGP, MAIL, AND CGI LIBRARIES. PGP Interface Library

C HAPTER E IGHTEEN T HE PGP, MAIL, AND CGI LIBRARIES. PGP Interface Library C HAPTER E IGHTEEN T HE PGP, MAIL, AND CGI LIBRARIES The PGP (pgp-lib.pl), mail (mail-lib.pl), and CGI (cgi-lib.pl) libraries are general libraries that support Web-store-specific functions. For example,

More information

JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved.

JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved. 1 6 JavaScript: Introduction to Scripting 2 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask,

More information

VB.NET Programming Fundamentals

VB.NET Programming Fundamentals Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements

More information

Top 72 Perl Interview Questions and Answers

Top 72 Perl Interview Questions and Answers Top 72 Perl Interview Questions and Answers 1. Difference between the variables in which chomp function work? Scalar: It is denoted by $ symbol. Variable can be a number or a string. Array: Denoted by

More information

A Simple Shopping Cart using CGI

A Simple Shopping Cart using CGI A Simple Shopping Cart using CGI Professor Don Colton, BYU Hawaii March 5, 2004 In this section of the course, we learn to use CGI and Perl to create a simple web-based shopping cart program. We assume

More information

Learn Perl by Example - Perl Handbook for Beginners - Basics of Perl Scripting Language

Learn Perl by Example - Perl Handbook for Beginners - Basics of Perl Scripting Language Learn Perl by Example - Perl Handbook for Beginners - Basics of Perl Scripting Language www.freebsdonline.com Copyright 2006-2008 www.freebsdonline.com 2008/01/29 This course is about Perl Programming

More information

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2 Unix Shell Scripts Norman Matloff July 30, 2008 Contents 1 Introduction 1 2 Invoking Shell Scripts 2 2.1 Direct Interpretation....................................... 2 2.2 Indirect Interpretation......................................

More information

Perl/CGI. CS 299 Web Programming and Design

Perl/CGI. CS 299 Web Programming and Design Perl/CGI CGI Common: Gateway: Programming in Perl Interface: interacts with many different OSs CGI: server programsprovides uses a well-defined users with a method way to to gain interact access with to

More information

PL / SQL Basics. Chapter 3

PL / SQL Basics. Chapter 3 PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic

More information

PHP Tutorial From beginner to master

PHP Tutorial From beginner to master PHP Tutorial From beginner to master PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

More information

Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA

Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Data Integrator Event Management Guide Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Telephone: 888.296.5969 or 512.231.6000 Fax: 512.231.6010 Email: info@pervasiveintegration.com

More information

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence Web Development Owen Sacco ICS2205/ICS2230 Web Intelligence Introduction Client-Side scripting involves using programming technologies to build web pages and applications that are run on the client (i.e.

More information

Introduction to Perl

Introduction to Perl Introduction to Perl March 8, 2011 by Benjamin J. Lynch http://msi.umn.edu/~blynch/tutorial/perl.pdf Outline What Perl Is When Perl Should Be used Basic Syntax Examples and Hands-on Practice More built-in

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

6. Control Structures

6. Control Structures - 35 - Control Structures: 6. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose,

More information

6.170 Tutorial 3 - Ruby Basics

6.170 Tutorial 3 - Ruby Basics 6.170 Tutorial 3 - Ruby Basics Prerequisites 1. Have Ruby installed on your computer a. If you use Mac/Linux, Ruby should already be preinstalled on your machine. b. If you have a Windows Machine, you

More information

10CS73:Web Programming

10CS73:Web Programming 10CS73:Web Programming Question Bank Fundamentals of Web: 1.What is WWW? 2. What are domain names? Explain domain name conversion with diagram 3.What are the difference between web browser and web server

More information

#!/usr/bin/perl use strict; use warnings; use Carp; use Data::Dumper; use Tie::IxHash; use Gschem 3; 3. Setup and initialize the global variables.

#!/usr/bin/perl use strict; use warnings; use Carp; use Data::Dumper; use Tie::IxHash; use Gschem 3; 3. Setup and initialize the global variables. 1. Introduction. This program creates a Bill of Materials (BOM) by parsing a gschem schematic file and grouping components that have identical attributes (except for reference designator). Only components

More information

Introduction to Python

Introduction to Python WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language

More information

Python Lists and Loops

Python Lists and Loops WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show

More information

Programming in Perl CSCI-2962 Final Exam

Programming in Perl CSCI-2962 Final Exam Rules and Information: Programming in Perl CSCI-2962 Final Exam 1. TURN OFF ALL CELULAR PHONES AND PAGERS! 2. Make sure you are seated at least one empty seat away from any other student. 3. Write your

More information

TCP/IP Networking, Part 2: Web-Based Control

TCP/IP Networking, Part 2: Web-Based Control TCP/IP Networking, Part 2: Web-Based Control Microchip TCP/IP Stack HTTP2 Module 2007 Microchip Technology Incorporated. All Rights Reserved. Building Embedded Web Applications Slide 1 Welcome to the next

More information

Computer Programming C++ Classes and Objects 15 th Lecture

Computer Programming C++ Classes and Objects 15 th Lecture Computer Programming C++ Classes and Objects 15 th Lecture 엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University Copyrights 2013 Eom, Hyeonsang All Rights Reserved Outline

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Data Tool Platform SQL Development Tools

Data Tool Platform SQL Development Tools Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6

More information

CHAPTER 7. E-Mailing with CGI

CHAPTER 7. E-Mailing with CGI CHAPTER 7 E-Mailing with CGI OVERVIEW One of the most important tasks of any CGI program is ultimately to let someone know that something has happened. The most convenient way for users is to have this

More information

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved. 1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays

More information

NewsletterAdmin 2.4 Setup Manual

NewsletterAdmin 2.4 Setup Manual NewsletterAdmin 2.4 Setup Manual Updated: 7/22/2011 Contact: corpinteractiveservices@crain.com Contents Overview... 2 What's New in NewsletterAdmin 2.4... 2 Before You Begin... 2 Testing and Production...

More information

Variables, Constants, and Data Types

Variables, Constants, and Data Types Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class: L&L, 2.1-2.3, App C 1 Primitive Data There are eight

More information

Welcome to Introduction to programming in Python

Welcome to Introduction to programming in Python Welcome to Introduction to programming in Python Suffolk One, Ipswich, 4:30 to 6:00 Tuesday Jan 14, Jan 21, Jan 28, Feb 11 Welcome Fire exits Toilets Refreshments 1 Learning objectives of the course An

More information

Training Module 4: Document Management

Training Module 4: Document Management Training Module 4: Document Management Copyright 2011 by Privia LLC. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval Contents Contents...

More information

Who s Doing What? Analyzing Ethernet LAN Traffic

Who s Doing What? Analyzing Ethernet LAN Traffic by Paul Barry, paul.barry@itcarlow.ie Abstract A small collection of Perl modules provides the basic building blocks for the creation of a Perl-based Ethernet network analyzer. I present a network analyzer

More information

DTD Tutorial. About the tutorial. Tutorial

DTD Tutorial. About the tutorial. Tutorial About the tutorial Tutorial Simply Easy Learning 2 About the tutorial DTD Tutorial XML Document Type Declaration commonly known as DTD is a way to describe precisely the XML language. DTDs check the validity

More information

Computational Mathematics with Python

Computational Mathematics with Python Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1

More information

Excel: Introduction to Formulas

Excel: Introduction to Formulas Excel: Introduction to Formulas Table of Contents Formulas Arithmetic & Comparison Operators... 2 Text Concatenation... 2 Operator Precedence... 2 UPPER, LOWER, PROPER and TRIM... 3 & (Ampersand)... 4

More information

10.1 The Common Gateway Interface

10.1 The Common Gateway Interface 10.1 The Common Gateway Interface - Markup languages cannot be used to specify computations, interactions with users, or to provide access to databases - CGI is a common way to provide for these needs,

More information

Dialog planning in VoiceXML

Dialog planning in VoiceXML Dialog planning in VoiceXML Csapó Tamás Gábor 4 January 2011 2. VoiceXML Programming Guide VoiceXML is an XML format programming language, describing the interactions between human

More information

Computational Mathematics with Python

Computational Mathematics with Python Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40

More information

PL/SQL Overview. Basic Structure and Syntax of PL/SQL

PL/SQL Overview. Basic Structure and Syntax of PL/SQL PL/SQL Overview PL/SQL is Procedural Language extension to SQL. It is loosely based on Ada (a variant of Pascal developed for the US Dept of Defense). PL/SQL was first released in ١٩٩٢ as an optional extension

More information

JavaScript: Control Statements I

JavaScript: Control Statements I 1 7 JavaScript: Control Statements I 7.1 Introduction 2 The techniques you will learn here are applicable to most high-level languages, including JavaScript 1 7.2 Algorithms 3 Any computable problem can

More information

Microsoft Windows PowerShell v2 For Administrators

Microsoft Windows PowerShell v2 For Administrators Course 50414B: Microsoft Windows PowerShell v2 For Administrators Course Details Course Outline Module 1: Introduction to PowerShell the Basics This module explains how to install and configure PowerShell.

More information

TIP: To access the WinRunner help system at any time, press the F1 key.

TIP: To access the WinRunner help system at any time, press the F1 key. CHAPTER 11 TEST SCRIPT LANGUAGE We will now look at the TSL language. You have already been exposed to this language at various points of this book. All the recorded scripts that WinRunner creates when

More information

ESPResSo Summer School 2012

ESPResSo Summer School 2012 ESPResSo Summer School 2012 Introduction to Tcl Pedro A. Sánchez Institute for Computational Physics Allmandring 3 D-70569 Stuttgart Germany http://www.icp.uni-stuttgart.de 2/26 Outline History, Characteristics,

More information

Qlik REST Connector Installation and User Guide

Qlik REST Connector Installation and User Guide Qlik REST Connector Installation and User Guide Qlik REST Connector Version 1.0 Newton, Massachusetts, November 2015 Authored by QlikTech International AB Copyright QlikTech International AB 2015, All

More information

Command Scripts. 13.1 Running scripts: include and commands

Command Scripts. 13.1 Running scripts: include and commands 13 Command Scripts You will probably find that your most intensive use of AMPL s command environment occurs during the initial development of a model, when the results are unfamiliar and changes are frequent.

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Web development... the server side (of the force)

Web development... the server side (of the force) Web development... the server side (of the force) Fabien POULARD Document under license Creative Commons Attribution Share Alike 2.5 http://www.creativecommons.org/learnmore Web development... the server

More information

SnapLogic Tutorials Document Release: October 2013 SnapLogic, Inc. 2 West 5th Ave, Fourth Floor San Mateo, California 94402 U.S.A. www.snaplogic.

SnapLogic Tutorials Document Release: October 2013 SnapLogic, Inc. 2 West 5th Ave, Fourth Floor San Mateo, California 94402 U.S.A. www.snaplogic. Document Release: October 2013 SnapLogic, Inc. 2 West 5th Ave, Fourth Floor San Mateo, California 94402 U.S.A. www.snaplogic.com Table of Contents SnapLogic Tutorials 1 Table of Contents 2 SnapLogic Overview

More information

Chapter 2: Elements of Java

Chapter 2: Elements of Java Chapter 2: Elements of Java Basic components of a Java program Primitive data types Arithmetic expressions Type casting. The String type (introduction) Basic I/O statements Importing packages. 1 Introduction

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

More information

C Language Tutorial. Version 0.042 March, 1999

C Language Tutorial. Version 0.042 March, 1999 C Language Tutorial Version 0.042 March, 1999 Original MS-DOS tutorial by Gordon Dodrill, Coronado Enterprises. Moved to Applix by Tim Ward Typed by Karen Ward C programs converted by Tim Ward and Mark

More information

Job Cost Report JOB COST REPORT

Job Cost Report JOB COST REPORT JOB COST REPORT Job costing is included for those companies that need to apply a portion of payroll to different jobs. The report groups individual pay line items by job and generates subtotals for each

More information

Visual Logic Instructions and Assignments

Visual Logic Instructions and Assignments Visual Logic Instructions and Assignments Visual Logic can be installed from the CD that accompanies our textbook. It is a nifty tool for creating program flowcharts, but that is only half of the story.

More information

Windows PowerShell Essentials

Windows PowerShell Essentials Windows PowerShell Essentials Windows PowerShell Essentials Edition 1.0. This ebook is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited. All rights

More information

Limitation of Liability

Limitation of Liability Limitation of Liability Information in this document is subject to change without notice. THE TRADING SIGNALS, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES,

More information

Hands-On UNIX Exercise:

Hands-On UNIX Exercise: Hands-On UNIX Exercise: This exercise takes you around some of the features of the shell. Even if you don't need to use them all straight away, it's very useful to be aware of them and to know how to deal

More information

Python Loops and String Manipulation

Python Loops and String Manipulation WEEK TWO Python Loops and String Manipulation Last week, we showed you some basic Python programming and gave you some intriguing problems to solve. But it is hard to do anything really exciting until

More information

CS2043 - Unix Tools & Scripting Lecture 9 Shell Scripting

CS2043 - Unix Tools & Scripting Lecture 9 Shell Scripting CS2043 - Unix Tools & Scripting Lecture 9 Shell Scripting Spring 2015 1 February 9, 2015 1 based on slides by Hussam Abu-Libdeh, Bruno Abrahao and David Slater over the years Announcements Coursework adjustments

More information

SAPScript. A Standard Text is a like our normal documents. In Standard Text, you can create standard documents like letters, articles etc

SAPScript. A Standard Text is a like our normal documents. In Standard Text, you can create standard documents like letters, articles etc SAPScript There are three components in SAPScript 1. Standard Text 2. Layout Set 3. ABAP/4 program SAPScript is the Word processing tool of SAP It has high level of integration with all SAP modules STANDARD

More information

Hands-on Exercise 1: VBA Coding Basics

Hands-on Exercise 1: VBA Coding Basics Hands-on Exercise 1: VBA Coding Basics This exercise introduces the basics of coding in Access VBA. The concepts you will practise in this exercise are essential for successfully completing subsequent

More information

Moving from C++ to VBA

Moving from C++ to VBA Introduction College of Engineering and Computer Science Mechanical Engineering Department Mechanical Engineering 309 Numerical Analysis of Engineering Systems Fall 2014 Number: 15237 Instructor: Larry

More information

On Generation of Firewall Log Status Reporter (SRr) Using Perl

On Generation of Firewall Log Status Reporter (SRr) Using Perl On Generation of Firewall Log Status Reporter (SRr) Using Perl Sugam Sharma 1, Hari Cohly 2, and Tzusheng Pei 2 1 Department of Computer Science, Iowa State University, USA sugam.k.sharma@gmail.com 2 Center

More information

Exercise 4 Learning Python language fundamentals

Exercise 4 Learning Python language fundamentals Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also

More information

IT350 Web and Internet Programming Fall 2008 SlideSet #11: CGI and Perl. (some from online chapter: www.deitel.com/books/iw3htp4/

IT350 Web and Internet Programming Fall 2008 SlideSet #11: CGI and Perl. (some from online chapter: www.deitel.com/books/iw3htp4/ IT350 Web and Internet Programming Fall 2008 SlideSet #11: CGI and Perl (some from online chapter: www.deitel.com/books/iw3htp4/ Things we ll learn and do XHTML basics, tables, forms, frames FLASHBACK

More information

ACCELL/SQL: Creating Reports with RPT Report Writer

ACCELL/SQL: Creating Reports with RPT Report Writer ACCELL/SQL: Creating Reports with RPT Report Writer 2 3 4 5 6 7 8 This manual, Creating Reports With RPT Report Writer, tells you how to develop an application report using Report Writer and gives complete

More information

In order to understand Perl objects, you first need to understand references in Perl. See perlref for details.

In order to understand Perl objects, you first need to understand references in Perl. See perlref for details. NAME DESCRIPTION perlobj - Perl object reference This document provides a reference for Perl's object orientation features. If you're looking for an introduction to object-oriented programming in Perl,

More information

Litigation Support connector installation and integration guide for Summation

Litigation Support connector installation and integration guide for Summation Litigation Support connector installation and integration guide for Summation For AccuRoute v2.3 July 28, 2009 Omtool, Ltd. 6 Riverside Drive Andover, MA 01810 Phone: +1/1 978 327 5700 Toll-free in the

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Social Science Research Lab American University, Washington, D.C. Web. www.american.edu/provost/ctrl/pclabs.cfm Tel. x3862 Email. SSRL@American.edu Course Objective This course provides

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

13 Classes & Objects with Constructors/Destructors

13 Classes & Objects with Constructors/Destructors 13 Classes & Objects with Constructors/Destructors 13.1 Introduction In object oriented programming, the emphasis is on data rather than function. Class is a way that binds the data & function together.

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Selecting Features by Attributes in ArcGIS Using the Query Builder

Selecting Features by Attributes in ArcGIS Using the Query Builder Helping Organizations Succeed with GIS www.junipergis.com Bend, OR 97702 Ph: 541-389-6225 Fax: 541-389-6263 Selecting Features by Attributes in ArcGIS Using the Query Builder ESRI provides an easy to use

More information

Writing Control Structures

Writing Control Structures Writing Control Structures Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 5-1 Objectives After completing this lesson, you should be able to do the following: Identify

More information

Understand for FORTRAN

Understand for FORTRAN Understand Your Software... Understand for FORTRAN User Guide and Reference Manual Version 1.4 Scientific Toolworks, Inc. Scientific Toolworks, Inc. 1579 Broad Brook Road South Royalton, VT 05068 Copyright

More information

Chapter 5 Names, Bindings, Type Checking, and Scopes

Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Scope Scope and Lifetime Referencing Environments Named

More information

Using Functions, Formulas and Calculations in SAP BusinessObjects Web Intelligence

Using Functions, Formulas and Calculations in SAP BusinessObjects Web Intelligence Using Functions, Formulas and Calculations in SAP BusinessObjects Web Intelligence SAP BusinessObjects XI 3.1 Service Pack 3 Copyright 2010 SAP AG. All rights reserved.sap, R/3, SAP NetWeaver, Duet, PartnerEdge,

More information

Designing and Implementing Forms 34

Designing and Implementing Forms 34 C H A P T E R 34 Designing and Implementing Forms 34 You can add forms to your site to collect information from site visitors; for example, to survey potential customers, conduct credit-card transactions,

More information

DeltaPAY v2 Merchant Integration Specifications (HTML - v1.9)

DeltaPAY v2 Merchant Integration Specifications (HTML - v1.9) DeltaPAY v2 Merchant Integration Specifications (HTML - v1.9) Overview This document provides integration and usage instructions for using DeltaPAY card processing system as a payment mechanism in e-commerce

More information

Lecture 2 Notes: Flow of Control

Lecture 2 Notes: Flow of Control 6.096 Introduction to C++ January, 2011 Massachusetts Institute of Technology John Marrero Lecture 2 Notes: Flow of Control 1 Motivation Normally, a program executes statements from first to last. The

More information

Lecture 5: Java Fundamentals III

Lecture 5: Java Fundamentals III Lecture 5: Java Fundamentals III School of Science and Technology The University of New England Trimester 2 2015 Lecture 5: Java Fundamentals III - Operators Reading: Finish reading Chapter 2 of the 2nd

More information

Creating Cost Recovery Layouts

Creating Cost Recovery Layouts Contents About Creating Cost Recovery Layouts Creating New Layouts Defining Record Selection Rules Testing Layouts Processing Status Creating Cost Recovery Layouts About Creating Cost Recovery Layouts

More information

Kiwi SyslogGen. A Freeware Syslog message generator for Windows. by SolarWinds, Inc.

Kiwi SyslogGen. A Freeware Syslog message generator for Windows. by SolarWinds, Inc. Kiwi SyslogGen A Freeware Syslog message generator for Windows by SolarWinds, Inc. Kiwi SyslogGen is a free Windows Syslog message generator which sends Unix type Syslog messages to any PC or Unix Syslog

More information

Shell Scripts (1) For example: #!/bin/sh If they do not, the user's current shell will be used. Any Unix command can go in a shell script

Shell Scripts (1) For example: #!/bin/sh If they do not, the user's current shell will be used. Any Unix command can go in a shell script Shell Programming Shell Scripts (1) Basically, a shell script is a text file with Unix commands in it. Shell scripts usually begin with a #! and a shell name For example: #!/bin/sh If they do not, the

More information

Thoroughbred Basic TM ODBC Client Capability Customization Supplement

Thoroughbred Basic TM ODBC Client Capability Customization Supplement Thoroughbred Basic TM ODBC Client Capability Customization Supplement Version 8.8.0 46 Vreeland Drive, Suite 1 Skillman, NJ 08558-2638 Telephone: 732-560-1377 Outside NJ 800-524-0430 Fax: 732-560-1594

More information

Using This Reference Manual Chapter 1 to Issue ACL Commands

Using This Reference Manual Chapter 1 to Issue ACL Commands Copyright 1998 ACL Services Ltd. All rights reserved No part of this manual may be reproduced or transmitted in any form by any means, electronic or mechanical, including photocopying and recording, information

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

MATLAB Programming. Problem 1: Sequential

MATLAB Programming. Problem 1: Sequential Division of Engineering Fundamentals, Copyright 1999 by J.C. Malzahn Kampe 1 / 21 MATLAB Programming When we use the phrase computer solution, it should be understood that a computer will only follow directions;

More information

Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS...

Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS... Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS... 3 CHANGE A JOIN PROPERTY... 4 REMOVING A JOIN... 4 CREATE QUERIES... 4 THE

More information

Perl for System Administration. Jacinta Richardson Paul Fenwick

Perl for System Administration. Jacinta Richardson Paul Fenwick Perl for System Administration Jacinta Richardson Paul Fenwick Perl for System Administration by Jacinta Richardson and Paul Fenwick Copyright 2006-2008 Jacinta Richardson (jarich@perltraining.com.au)

More information

Administration Guide. BlackBerry Resource Kit for BES12. Version 12.3

Administration Guide. BlackBerry Resource Kit for BES12. Version 12.3 Administration Guide BlackBerry Resource Kit for BES12 Version 12.3 Published: 2015-10-30 SWD-20151022151109848 Contents Compatibility with other releases...4 BES12 Log Monitoring Tool... 5 Specifying

More information

BASH Scripting. A bash script may consist of nothing but a series of command lines, e.g. The following helloworld.sh script simply does an echo.

BASH Scripting. A bash script may consist of nothing but a series of command lines, e.g. The following helloworld.sh script simply does an echo. BASH Scripting bash is great for simple scripts that automate things you would otherwise by typing on the command line. Your command line skills will carry over to bash scripting and vice versa. bash comments

More information

Computational Mathematics with Python

Computational Mathematics with Python Numerical Analysis, Lund University, 2011 1 Computational Mathematics with Python Chapter 1: Basics Numerical Analysis, Lund University Claus Führer, Jan Erik Solem, Olivier Verdier, Tony Stillfjord Spring

More information