31 Pages

6-Functions

Course: CS 212, Fall 2009
School: Sveriges...
Rating:
 
 
 
 
 

Word Count: 2979

Document Preview

CMPT-212 SFU 2008-1 1 Topic: Functions SFU CMPT-212 2008-1 Topic: Functions J n Manuch a E-mail: jmanuch@sfu.ca Wednesday 6th February, 2008 Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 2 Topic: Functions Functions Functions are an essential building block of structured and object-oriented programming. Phases in the life cycle of a function: function prototype...

Register Now

Unformatted Document Excerpt

Coursehero >> Other International >> Sveriges lantbruksuniversitet >> CS 212

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
CMPT-212 SFU 2008-1 1 Topic: Functions SFU CMPT-212 2008-1 Topic: Functions J n Manuch a E-mail: jmanuch@sfu.ca Wednesday 6th February, 2008 Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 2 Topic: Functions Functions Functions are an essential building block of structured and object-oriented programming. Phases in the life cycle of a function: function prototype (function declaration): describes the shell of a function (name, parameters and return value) return_type function_name(parameters); function denition: describes what the function does 1 2 return_type function_name(parameters) { statements } // function body function call: using the function within other code function_name(arguments) Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 3 Topic: Functions Function call Consider a function: 1 double cube(double x) { return x*x*x; } What happens when we call the function? 1 2 double a=1.2; double b=cube(a); program stores the address of the next instruction copies the values of arguments to the stack (passing the arguments) jumps to the address of the function executes function if needed, places a return value in a specied location (a register or memory) jumps to the saved address Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 4 Topic: Functions Function prototype describes the function interface to the compiler purpose: the compiler knows what kind of arguments to look for on the stack when it starts executing the function; and knows what return value to retrieve from the specied location after it nishes execution of the function Note: does not need to provide the names of parameters (just types), and the names can be different from those specied in the function denition Note: you have to specify type for each parameter Example: 1 2 double length(double a, b); // incorrect double length(double a, double b); // correct automatic conversions: arguments and returned value are automatically converted to types specied in the prototype Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 5 Topic: Functions void Note. The void type indicates nothing. No variables can be declared as void (but you can declare a pointer void *, which can point to anything). Uses of void: as the only parameter of a function with no parameters (optional) as the return value of a procedure, a function that does not return any values (mandatory) Note: in C, an empty parameter list means that function can take any number of arguments (e.g., printf); in C++, it means no parameters! Remark: to see how to declare a function with a variable number of parameters, look at http://www.mycplus.com/tutorial.asp?TID=177 Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 6 Topic: Functions Sample questions What happens when a function is called? Consider the following function 1 2 float cube( double x) { return x*x*x; } and the following line of code int a,b=2; a=cube(b); How many conversions happen when program executes line 2 of the code? 1 2 Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 7 Topic: Functions Passing the function arguments 3 possibilities: by value by address (through a pointer) by reference (C++ feature) Note. Unless explicitly specied, C++ passes function arguments by value. Example: swap1.cpp Note (Passing arguments by address). Basically, its again passing arguments by value, but the arguments are pointers to data. Example: swap2.cpp Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 8 Topic: Functions Passing arrays syntax: 1 2 int sum(int array[], int size); // or int sum(int *array, int size); the above declaration are equivalent (remember arrays are pointers). If we call 1 2 int a[10]; // declaration sum(a); // function call in function sum, array[1] will access directly a[1]. Example: arrfun2.cpp [Prata] For multidimensional arrays, you have to specify all sizes but the rst in the type: 1 2 3 int data[5][5][5]; // 5x5x5 array // ... int sum(int a[][5][5], int xSize); // prototype of the function 2008 J n Ma uch a n Last modied: Wednesday 6th February, 2008, 00:21 SFU CMPT-212 2008-1 9 Topic: Functions const Question: How to protect elements of an array passed to a function which is not supposed to modify the array? Answer: Use const. Example: 1 2 3 4 int sum(const int array[], int size) { array[1]=10; // compiler error ... } array is an array to const int, each element of the array has a const value (within function sum) which cannot be modied Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 10 Topic: Functions Note the difference: 1 2 3 4 5 6 7 int a,b; const int *pa=&a; // a pointer to const int int *const pb=&a; // a const pointer to int pa=&b; // VALID pb=&b; // INVALID *pa=10; // INVALID *pb=10; // VALID Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 11 Topic: Functions why to use pointer/array to const data? protects from programming errors (unwanted modication to data) you can use const arguments in a function call Example: 1 2 3 4 5 6 7 8 int sum(int *array, int size); int sum_const(const int *array, int size); int main() { const int a[asize]={1,2,3,4,5}; sum(a,asize); // compiler error sum_const(a,asize); // OK } Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 12 Topic: Functions Passing structures recall structures can be assigned one to another (memberwise assignment) when passing structures by value, a copy of the original structure is created Example: travel1.cpp [Prata] not efcient: values are copied uselessly pass structure addresses instead (or references, as we will see later): travel_time *sum(travel_time *t1, travel_time *t2) Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 13 Topic: Functions Problem: sum has to allocate memory for new structure travel_time and the user of sum should remember to free the structure after using it! beware: do not return an address of a local variable! Local variable scope: Variables declared inside a function are no longer available after the completion of the function call. there is a better solution: instead of returning the structure its better if the user of sum provides the structure where to write the result Example: travel2.cpp Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 14 Topic: Functions Passing arguments by reference Function arguments can be passed by reference using the reference operator &. This operator is different from the address operator. Example: swap3.cpp Reference variables 1 2 int count; int &c=count; // c is an alias for count Example: rstref.cpp [Prata] Note: You cannot assign value to reference in other place then in declaration: 1 2 3 4 int count,count2; int &c; // compiler error; // reference variable has to be initialized c=count2; 2008 J n Ma uch a n Last modied: Wednesday 6th February, 2008, 00:21 SFU CMPT-212 2008-1 15 Topic: Functions Reference properties What happens if call swap from swap3.cpp as follows: 1 2 int x,y; swap(x+2,y); // compiler error x+2 creates a temporary variable containing the value of x which is passed to swap the value of y would be lost after swapping (the temporary variable exists only temporarily) hence, the call above is forbidden by compiler When is a temporary variable created? the argument is not an Lvalue, i.e., it cannot be assigned a value: either expression, or a constant wrong type argument, requiring conversion Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 16 Topic: Functions Note: A temporary variable can be used as a argument to a reference parameter, but it has to be a const reference. Example: 1 2 3 4 5 6 7 8 double cube(const double &side) { // side += 1; // compiler error: side is const return side*side*side; } int main() { double a=cube(1.2); // ok } Question: If we dont want to modify the value, wouldnt it be easier to use passing by value for side instead? Answer: Yes. However, passing by a const reference make sense when passing big structures, which are not going to be modied. (Passing by value would make a copy of each data member of the structure.) Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 17 Topic: Functions When to use reference arguments? to be able to modify the object, to avoid copying entire object, to return a reference from a function to an existing object and avoid copying the object. In all cases we could use pointers too, but using references is easier. Example: travel3.cpp Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 18 Topic: from Functions Returning functions By default, functions return values by value (travel1.cpp). From the point of view of program ow, the effect of return on a function is similar to the effect of break on a loop. Note. Function calls cannot appear on the left sides of assignments unless a pointer is returned and dereferenced: Lside1.cpp; or a reference is returned: Lside2.cpp. Note: Never return a reference to a local variable! Example: 1 2 3 4 5 travel_time & estimate() { travel_time t = {4, 32}; return t; // dangerous! } 2008 J n Ma uch a n Last modied: Wednesday 6th February, 2008, 00:21 SFU CMPT-212 2008-1 19 Topic: Functions Sample questions What are the possibilities of passing arguments to functions? Show three short examples for each possibility. What is the difference between the following declarations? 1 2 3 int a; const int *p=&a; int *const p=&a; In which situation its necessary to use a const reference for a parameter to the function instead of a non-const reference? Which of the following lines will generate a compiler error. Explain why! 1 2 3 4 int i,j; int &k=&j; int *p=&i; *p=&j; 2008 J n Ma uch a n Last modied: Wednesday 6th February, 2008, 00:21 SFU CMPT-212 2008-1 20 Topic: Functions What is the advantage of passing an argument by constant reference over passing by value? Whats wrong with the following code? 1 2 3 4 5 6 7 void print(double & a) { cout <<"double: "<<a; } // .. double x=3.1; print(x+0.1); How would you x it? Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 21 Topic: Functions Pointers to Functions Functions are code entry points in memory, with memory addresses. Function addresses can be assigned to pointer variables. declaration: 1 return_type ( *pointer_name )( arguments ); Example: double (*pf)(int,int); pf is a pointer to function that takes two ints and returns double Note: double *pf(int,int); is a prototype of a function that takes two ints and returns a pointer to double taking the address of a function: just use the name of the function Example: 1 2 double add(int,int); // a prototype of function pf=add; // pf points to the add() functio 2008 J n Ma uch a n Last modied: Wednesday 6th February, 2008, 00:21 SFU CMPT-212 2008-1 22 Topic: Functions using a pointer to call a function: 1 2 (*pointer_name)( parameters ); // C style pointer_name( parameters ); // C++ style Example: 1 2 3 int i,j; double a=(*pf)(1,2); double b=pf(i,j); Usage: generic functions; Example: generic.cpp hooks; Example: atexit.cpp Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 23 Topic: Functions Inline functions the compiler (probably) replaces the function call with the function code as we have seen when calling a function, there is a certain machinery taking place, which takes time if we have a function with a short code which executes fast (compared to the machinery) and is called often, it makes sense to declare the function as an inline function inline functions are declared with the inline keyword: inline double cube(double x); advantage: faster execution of the function disadvantage: the code of the function will appear in the executable le as many times as the number of places calling the function Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 24 Topic: Functions Default arguments Function parameters, starting with the last, can be assigned default values. Example: int func(int i, int j=3, int k=5) This way, the number of parameters of a function can be variable up to a maximum number of parameters. Example: 1 2 3 func(5); // calls func(5,3,5) func(5,6); // calls func(5,6,5) func(5,6,7); Default parameters are allowed either in the function prototype (usually) or the function denition, but not both. Example: default.cpp Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 25 Topic: Functions Function Overloading (Polymorphism) the same name can be used for multiple functions with different argument lists (also called function signatures) the compiler will automatically recognize which version of the function to call by the number and types of arguments Example: overloading.cpp reference to a type and the type have the same signature if the arguments doesnt match any signature, the compiler tries to use automatic conversions to match them; there can be several ways how to do it: if this happens we get a compiler error ambiguous call (exception: const, see overloading2.cpp) Usage: functions performing the same task on different forms of data Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a n SFU CMPT-212 2008-1 26 Topic: Functions Function templates Function templates are high-level mechanisms designed for dealing with structurally similar processing for different types of data. Function templates are a code abstraction mechanism. Example: swap4.cpp Function templates are not functions, they are generic function descriptions. Note (Implicit instantiation). An instance of a function template is created implicitly by matching parameters of a call with the argument templates. Example: 1 2 int i,j; Swap(i,j); the compiler generates the int version of function Swap and calls it Last modied: Wednesday 6th February, 2008, 00:21 2008 J n Ma uch a...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Sveriges lantbruksuniversitet - CS - 212
SFU CMPT-212 2008-11Topic: Control StatementsSFU CMPT-212 2008-1 Topic: Control Statements J n Manuch a E-mail: jmanuch@sfu.ca Wednesday 23rd January, 2008Last modied: Wednesday 23rd January, 2008, 10:012008 J n Ma uch a nSFU CMPT-212 20
Sveriges lantbruksuniversitet - CS - 212
CMPT 212 (2008-1) Assignment 4 - EvaluationJ n Ma uch a n jmanuch@sfu.ca1 Evaluation5 points the dialog window to enter size opens first; 3 points entering 0,0 does not let the user to continue; 5 points entering 5,5 opens the main window with gr
Sveriges lantbruksuniversitet - CS - 212
2a. Control StatementsNote: This section of the course has been adapted with minimal change from R. Tronts old C+ Cmpt 101 lectures. So it is presented in perhaps an overly simple way. However, it does contain the appropriate information on C+ boole
Sveriges lantbruksuniversitet - LING - 406
Some Terminology and Issues with PresuppositionsTRIGGERS: How is a presupposition introduced? (Answer: Conventionally, or by conversational maxims) PROJECTION: How a presupposition of a part is &quot;inherited&quot; by a larger piece of language that contains
Sveriges lantbruksuniversitet - PSYC - 20011
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: PSYC 106-3 D01 TITLE: SOCIAL ISSUES SEMESTER: 2001-1 LOCATION: SFU SECTION TYPE: LEC ENROL: 125= PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown sep
Sveriges lantbruksuniversitet - ARTS - 20011
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: GERO 402-3 E01 LOCATION: DOW TITLE: DRUG ISSUES IN GERO SECTION TYPE: SEM SEMESTER: 2001-1 ENROL: 14 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown
Sveriges lantbruksuniversitet - ARTS - 20033
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: WS 101-3 D01 LOCATION: SFU TITLE: INTRO-ISSUES IN CAN. SECTION TYPE: LEC SEMESTER: 2003-3 ENROL: 47 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown
Sveriges lantbruksuniversitet - EDUC - 20033
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 100-3 D02 LOCATION: SFU TITLE: QUES/ISSUES IN EDUC SECTION TYPE: SEM SEMESTER: 2003-3 ENROL: 30 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown
Sveriges lantbruksuniversitet - EDUC - 20033
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 240-3 ALL SECTIONS LOCATION: SFU OTH TITLE: SOCIAL ISSUES SECTION TYPE: LEC SEMESTER: 2003-3 ENROL: 173 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students n
Sveriges lantbruksuniversitet - APSC - 20033
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: CMNS 354-4 D01 LOCATION: SFU TITLE: CMNS/SOCIAL ISSUES SECTION TYPE: LEC SEMESTER: 2003-3 ENROL: 62 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown
Sveriges lantbruksuniversitet - EDUC - 20033
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 240-3 D03 TITLE: SOCIAL ISSUES SEMESTER: 2003-3 LOCATION: FJO SECTION TYPE: SEC ENROL: 30= PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown sepa
Bates - ATGE - 110
Astronomy/Geology 110 Tuesday, Thursday 2:40-4:00 pm Carnegie 204Tom Burbine tburbine@bates.eduCourse Course Website: http:/abacus.bates.edu/~tburbine/ATGE110/ Also on Lyceum.bates.edu Textbook: Moon and Planets (5th Edition) by William K. H
Sveriges lantbruksuniversitet - EDUC - 19971
PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 437-4 E01 LOCATION: SFU TITLE: ETHICAL ISSUES SECTION TYPE: SEM SEMESTER: 1997-1 ENROL: 10
Sveriges lantbruksuniversitet - EDUC - 19971
PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 240-3 D01 LOCATION: SFU TITLE: SOCIAL ISSUES SECTION TYPE: LEC SEMESTER: 1997-1 ENROL: 63
Sveriges lantbruksuniversitet - ARTS - 19971
PROFILE OF STUDENTS IN SFU COURSES COURSE: CRIM 320-3 C01 LOCATION: SFU TITLE: ADVN.RESEARCH ISSUES SECTION TYPE: SEC SEMESTER: 1997-1 ENROL: 30
Sveriges lantbruksuniversitet - BUS - 19971
PROFILE OF STUDENTS IN SFU COURSES COURSE: BUS 439-3 D01 LOCATION: MEX TITLE: N.AM.TRADE ISSUES SECTION TYPE: FLD SEMESTER: 1997-1 ENROL: 12
Sveriges lantbruksuniversitet - ARTS - 19971
PROFILE OF STUDENTS IN SFU COURSES COURSE: CRIM 320-3 D01 LOCATION: SFU TITLE: ADVN.RESEARCH ISSUES SECTION TYPE: LEC SEMESTER: 1997-1 ENROL: 10
Sveriges lantbruksuniversitet - ARTS - 19971
PROFILE OF STUDENTS IN SFU COURSES COURSE: WS 400-5 D01 LOCATION: SFU TITLE: METH. ISSUES IN W.S. SECTION TYPE: SEM SEMESTER: 1997-1 ENROL: 24
Sveriges lantbruksuniversitet - APSC - 19963
PROFILE OF STUDENTS IN SFU COURSES COURSE: CMNS 421-4 D01 LOCATION: DOW TITLE: ISSUES SEMINAR SECTION TYPE: SEM SEMESTER: 1996-3 ENROL: 28
Sveriges lantbruksuniversitet - EDUC - 19963
PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 240-3 D01 LOCATION: FJO TITLE: SOCIAL ISSUES SECTION TYPE: SEC SEMESTER: 1996-3 ENROL: 14
Sveriges lantbruksuniversitet - ARTS - 19963
PROFILE OF STUDENTS IN SFU COURSES COURSE: FPA 111-3 D01 LOCATION: SFU TITLE: ISSUES IN FPA SECTION TYPE: LEC SEMESTER: 1996-3 ENROL: 11
Sveriges lantbruksuniversitet - PHIL - 19963
PROFILE OF STUDENTS IN SFU COURSES COURSE: PHIL 321-3 E01 LOCATION: SFU TITLE: MORAL ISSUES/THEORY SECTION TYPE: LEC SEMESTER: 1996-3 ENROL: 34
Sveriges lantbruksuniversitet - ARTS - 19963
PROFILE OF STUDENTS IN SFU COURSES COURSE: WS 101-3 D01 LOCATION: SFU TITLE: INTRO-ISSUES IN CAN. SECTION TYPE: LEC SEMESTER: 1996-3 ENROL: 89
Sveriges lantbruksuniversitet - ARTS - 19972
PROFILE OF STUDENTS IN SFU COURSES COURSE: SA 340-4 D01 LOCATION: SFU TITLE: SOCIAL ISSUES SECTION TYPE: SEM SEMESTER: 1997-2 ENROL: 29
Sveriges lantbruksuniversitet - EDUC - 19972
PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 437-4 D01 LOCATION: SFU TITLE: ETHICAL ISSUES SECTION TYPE: SEM SEMESTER: 1997-2 ENROL: 18
Sveriges lantbruksuniversitet - ARTS - 19972
PROFILE OF STUDENTS IN SFU COURSES COURSE: SA 340-4 N01 LOCATION: KAM TITLE: SOCIAL ISSUES SECTION TYPE: SEC SEMESTER: 1997-2 ENROL: 4
Sveriges lantbruksuniversitet - APSC - 19972
PROFILE OF STUDENTS IN SFU COURSES COURSE: CMNS 421-4 D02 LOCATION: DOW TITLE: ISSUES SEMINAR SECTION TYPE: SEM SEMESTER: 1997-2 ENROL: 15
Sveriges lantbruksuniversitet - APSC - 19981
PROFILE OF STUDENTS IN SFU COURSES COURSE: CMNS 421-4 D01 LOCATION: SFU TITLE: ISSUES SEMINAR SECTION TYPE: SEM SEMESTER: 1998-1 ENROL: 11
Sveriges lantbruksuniversitet - ARTS - 19981
PROFILE OF STUDENTS IN SFU COURSES COURSE: CRIM 320-5 D01 LOCATION: SFU TITLE: ADVN RSRCH ISSUES SECTION TYPE: LEC SEMESTER: 1998-1 ENROL: 10
Sveriges lantbruksuniversitet - EDUC - 20011
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 240-3 D01 TITLE: SOCIAL ISSUES SEMESTER: 2001-1 LOCATION: SFU SECTION TYPE: LEC ENROL: 90= PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown sepa
Sveriges lantbruksuniversitet - ARTS - 20012
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: WS 101-3 C01 LOCATION: SFU TITLE: INTRO-ISSUES IN CAN. SECTION TYPE: SEC SEMESTER: 2001-2 ENROL: 48 = PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown
Sveriges lantbruksuniversitet - EDUC - 20012
Sheet1 PROFILE OF STUDENTS IN SFU COURSES COURSE: EDUC 437-4 D01 TITLE: ETHICAL ISSUES SEMESTER: 2001-2 LOCATION: SFU SECTION TYPE: SEM ENROL: 28= PROGRAM OF STUDENT (Top 5 programs reported in each category Programs with &lt; 3 students not shown sep
Sveriges lantbruksuniversitet - IR - 267
DNA HELIX-STACK SWITCHING AS THE BASIS FORTHE DESIGN OF VERSATILE DEOXYRIBOSENSORSCarlo Giovanni Sankar B.Sc., Simon Fraser University, 200 1THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE In the D
Sveriges lantbruksuniversitet - LIB - 267
DNA HELIX-STACK SWITCHING AS THE BASIS FORTHE DESIGN OF VERSATILE DEOXYRIBOSENSORSCarlo Giovanni Sankar B.Sc., Simon Fraser University, 200 1THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE In the D
Sveriges lantbruksuniversitet - IR - 3650
MINIMUM RATIO CONTOURS FOR MESHESbyAndrew Clements B.Comp., University of Guelph, 2003A THESIS SUBMITTED IN PARTIAL FULFILLMENT O F T H E REQUIREMENTS F O R T H E DEGREE O FMASTER OF SCIENCEin the SchoolofComputing Science@ Andrew Clemen
Toledo - STA - 414
STA 414/2104 S: January 20, 2009Administrative etc. HW 1 due on February 5 before 5 p.m. ofce hour normally Tuesday 3-4; on Jan 20 2-3 instead lm on prostate data; see web page and notes from lastweek feature variables lcavol, etc. were stand
Toledo - STA - 450
STA 450/4000 S: January 19, 2005Comments on regression from last day (Table 3.2) feature variables lcavol, etc. were standardized on the full data set; otherwise we wouldn't need an intercept because each predictor would have mean 0 xi (xi - x )
Toledo - STA - 2209
STA2209H F Lifetime Data Modelling and Analysis Fall Term 2001The courseand recurrent event data analysis. Topics include parametric models for lifetime and recurrent event data, regression models, parametric, semiparametric and nonparametric infe
Toledo - STA - 450
Notes No class this Friday or next Friday No ofce hours next Thursday or Friday HW 3 coming on Mar 16, due last day of classes project due 1 week after last day of classesSTA 450/4000 S: March 9 2005: ,1Tree-based methods (9.2) 9
Sveriges lantbruksuniversitet - MACM - 316
MACM 316 Midterm Exam, Instructor R. D. RussellDate: 10:30 AM, February 18, 19981. (a) Suppose that n + 1 distinct points X0, X1 . Xn are given. The values of a smooth function f(x) are also given at these points.Prove that there exists an inte
Toledo - PHY - 315
PHY 315S RADIATION IN PLANETARY ATMOSPHERES Spring Term, 2007 Mid-Term Test SolutionsQUESTIONS and BRIEF ANSWERS: 1. Briefly define each of the following (using no more than 2-3 sentences for each) [5 marks each, for 20 marks total].(a) Dobson uni
Toledo - PHY - 315
PHY 315S RADIATION IN PLANETARY ATMOSPHERES Spring Term, 2008 Mid-Term Test SolutionsQUESTIONS and BRIEF ANSWERS: 1. Briefly define each of the following (using no more than 2-3 sentences for each). [5 marks each, for 20 marks total](a) Radiant fl
Toledo - PHY - 140
PHY 140Y FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #11 Solutions November 26/27 Aberration of Starlight and the Michelson-Morley Experiment1. Figure 38-30, below, shows a plot of James Bradley's data on the aberration of light from the s
Toledo - PHY - 140
PHY 140Y FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #12 Solutions December 3/4 Lorentz Velocity Addition, Time Dilation, and Lorentz Contraction1. Two spaceships are travelling with velocities of 0.6c and 0.9c relative to a third observer
Toledo - PHY - 140
PHY 140Y FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #8 Solutions November 5/6 Conservation of Energy1. The masses shown below are connected by a massless string over a frictionless, massless pulley and are released from rest. Use energy c
Toledo - PHY - 140
PHY 140Y - FOUNDATIONS OF PHYSICS 2001-2002 Solutions for Tutorial Questions #1 September 17/18 Units and Dimensional Analysis1. The metre is now defined as the length of the path travelled by light in vacuum during a time interval of 1/299,792,458
Toledo - PHY - 140
PHY 140Y FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #7 Solutions October 29/30 Work, Energy, and Power1. A particle of mass m is suspended from a massless string of length L. The particle is displaced along a circular path of radius L fro
Toledo - PHY - 140
Toledo - PHY - 140
PHY 140Y FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #5 Solutions October 15/16 Applying Newton's Laws of Motion1. Blocks of 1.0, 2.0, and 3.0 kg are lined up from left to right in that order on a table so that each block is touching the n
Toledo - PHY - 140
Toledo - PHY - 140
PHY 140Y FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #9 Solutions November 12/13 Conservation of Energy and Springs1. One end of a massless spring is placed on a flat surface, with the other end pointing upward, as shown below. A mass of 3
Toledo - PHY - 140
PHY 140Y - FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #2 - Solutions September 24/25 Motion in a Straight Line1. Two cars are moving with a velocity vo = 40.0 m/s down a stretch of highway. They are displaced by a distance of 100.0 m. Both
Toledo - PHY - 140
PHY 140Y - FOUNDATIONS OF PHYSICS 2001-2002 Tutorial Questions #3 - Solutions October 1/2 Motion in More than One Dimension and Projectile Motion1. A projectile is launched over flat ground. At what angles with respect to the ground should the launc
Toledo - PHY - 140
Toledo - PHY - 315
PHY 315S RADIATION IN PLANETARY ATMOSPHERES Spring Term, 2006 Mid-Term Test SolutionsQUESTIONS and BRIEF ANSWERS: 1. Briefly define each of the following (using no more than 2-3 sentences for each) [4 marks each].(a) Radiant emittance (correction
Toledo - ENV - 200
Extending Ecolabel Standards to Include Soil and Water Quality: The Protected Harvest Approach (Session III A) Carolyn W. Brickey 1We have barely scratched the surface of the types of environmental benefits we can obtain from sustainable agricultur
Toledo - ENV - 200
Our life and purpose til the end of term Nov. 16, 18 (&amp; 23?) Tropospheric Issues: air &amp; water pollution (parts of Chp. 5 and 7) as they inform our understanding of the health consequences of exposure to contaminants Nov. (23?) 25 &amp; 30 Environment, h
Toledo - ENV - 200
NAME:_ TA:_December Term Test ENV200Y (2001-2002)Please look over these instructions while waiting for the examination to begin.YOU MUST USE PENCIL ON THE ANSWER SHEET! (If you have forgotten a pencil, let us know. We have pencils and a few erase
Toledo - ENV - 200
Sequestration11/2000TERRESTRIAL SEQUESTRATION PROGRAMCapture and Storage of Carbon in Terrestrial Ecosystems BackgroundCONTACT POINTSSarah M. Forbes Program Coordinator National Energy Technology Laboratory (304) 285-4670 sarah.forbes@netl.doe.
Toledo - ENV - 200
Pilot Environmental Sustainability IndexAn Initiative of the Global Leaders for Tomorrow Environment Task Force, World Economic ForumTABLE OF CONTENTS Executive Summary 4 The Need for an Environmental Sustainability Index 5 The Path Ahead 5 How th
Toledo - ENV - 200
Terrestrial Biodiversity and Protected AreasNorth Americas diminishing biological diversity has profound consequences. Because the loss is irreversiblespecies that are lost are lost foreverthe potential impact on the human condition, on the fabric