Objects and Classes. The Big Picture. Classes. Objects. Some paradigms of programming:
|
|
- Eric Gibbs
- 6 years ago
- Views:
Transcription
1 Object and Clae The Big Picture Some paradigm of programming: Imperative Programming ue explicit loop, conditional, variable Three paradigm of programming we cover in CS111. Functional Programming Ue function a building block (e.g, map, filter CS111 Computer Programming Object Oriented Programming (OOP ue object and their interaction to deign program. Department of Computer Science Welleley College Today: Study object with imple example Next time: Ue object in animation Object and Clae 2 Object An object i a data value that ha tate and behavior. Example: Python builtin type: number, tring, lit, tuple, dictionarie, c1graphic: circle, canvae, point, Object behavior are defined by method that can be invoked on an object. A method i a function that ha direct acce to the tate of an object. For example, method of a tring object include: "Computer Science".lower( "Computer Science".plit( "Computer Science".index('c' Different kind of object can handle the ame method in different way. For example,.cale( Everything in Python i an object (even function. cale the radiu of a c1graphic le object by cale the and of a c1graphic angle object by Clae A cla define the characteritic of a et of object or intance, including: Repreentation of State: how each object' tate i tored a intance variable in that object Implementation of Behavior: how object behavior i implemented a code for each object' method A cla i ued a a template for making object of one kind. An object made from a cla i called an intance of the cla. Example of clae include: tr lit int dict Canva Polygon le Layer Object are known a intance of a cla. Type help(tr or help(canvato ee all the method of thee clae. Object and Clae 3 Object and Clae 4
2 Cla Example: Geometric Figure Define geometric figure clae for circle, rectangle, etc. (Different from thoe in c1graphic. State: o The tate of a circle i it radiu and o The tate of a rectangle i it,, and o The tate of a quare i it ide length and Behavior: o Method that return the tate element o Method that change the tate element o Method to compute the perimeter & area of each figure Unlike c1graphic, we will not draw thee figure State i repreented by intance variable, behavior through method. Object and Clae 5 Object Memory Diagram Object memory diagram reemble thoe of r = (2, 1, "red" dictionarie. We call our clae and to dik = (50, "yellow" ditinguih them from the c1graphic = (,, le and angle clae. Object a cloud named by cla name containing intance variable (alo known a attribute, Object drawn member, a boxe or named field by cla name containing intance variable (alo known a attribute, member, or field r 2 1 dik radiu 50 "red" "yellow" le dik radiu 50 Ditinct intance of one cla have the ame "yellow" method and intance variable name, but they each hold ditinct intance variable content. Object and Clae 6 Big idea #1: Abtraction for Object Client Ue object method to inpect or manipulate abtract tate. hape.area(.getcolor(.etcolor(c hape.area( Contract / API: Method.area(.getColor(.etColor(c Implementation Concrete tate (intance variable and behavior (method code hape Client code ue object and their method without awarene of implementation. radiu 2 "yellow" cla : return ( math.pi *.radiu**2 Object and Clae 7 Method Contructor function invocation = (,, Method invocation.getwidth(.getheight(.getcolor(.perimeter( 54.area( 0 Some method change the tate of an object rather than returning omething.etwidth(30.etheight(25 To Notice - The contructor name tart in uppercae; it ha the name of the cla. - Some method only return a value, they are known a getter method. - Some method change value, are known a etter method. Object and Clae 8
3 Defining a Cla Keyword cla init method uually declare intance variable Definition of other intance method cla name init i pecial method automatically invoked each time a new object i created cla : '''A rectangle, pecified by,, and ''' def init (, w, h, c:. = w. = c Firt argument for any intance method i the receiver object that the method i invoked upon def getwidth(: """Return the rectangle' """ return.... A cla a a collection of function definition. They are all bound to the cla body. Object and Clae 9 Invoking a Contructor Function def init (, w, h, c:. = w. = c How to invoke the contructor: (,, cla name To Notice - The pecial method init ha two undercore at the tart and end. - The contructor function call implicitly init. - Although the init definition ha four parameter, during the invocation we provide only three argument. The pecial variable doen t receive a value explicitly. Object and Clae Invoking a Contructor Function (,, The memory diagram (tep-by-tep for creating an object during the contructor invocation. Invoking a Contructor Function (,, 1. Invoke init method with bound to new empty object for the cla and other parameter bound to contructor function argument 2. Execute tatement in body of init method. Thee may add new intance variable to object. init. = w. = c w h init. = w. = c w h c c Object and Clae 11 Object and Clae 12
4 Invoking a Contructor Function (,, 2. Execute tatement in body of init method. Thee may add new intance variable to object. Invoking a Contructor Function (,, 2. Execute tatement in body of init method. Thee may add new intance variable to object. init. = w. = c w h init. = w. = c w h c c Important: in thi example, parameter name are different from intance variable name in the object (w v.. Object and Clae 13 You could name them the ame, ( intead of w, but the functionality would remain the ame. Object and Clae 14 Invoking a Contructor Function Invoking an Intance Method: getwidth (,, 3. Object i returned a the reult of contructor invocation = (,, def getwidth(: return..getwidth( 1. Invoke getwidth method with bound to the receiver object argument. getwidth return. Why? Behavior i aociated with an object. Invoking a method end a meage (getwidth to the receiver object. The receiver object repond by running it getwidth method on it. A method i jut a function, but need an argument indicating the receiver object. The receiver i a pecial argument that alo determine what getwidth method i ued. Object and Clae The receiver argument i written differently to ditinguih it from other argument.
5 Invoking an Intance Method: getwidth Invoking an Intance Method: getwidth = (,, def getwidth(: return..getwidth( = (,, def getwidth(: return..getwidth( 2. Statement in the body are executed 3. Value i returned a reult of method invocation. getwidth return. Object and Clae Object and Clae 18 Invoking an Intance Method: etwidth Invoking an Intance Method: etwidth = (,, def etwidth(, newwidth:. = newwidth = (,, def etwidth(, newwidth:. = newwidth 30.etWidth(30.etWidth(30 1. Invoke etwidth method with bound to receiver object and newwidth bound to the argument 2. Statement in the body are executed etwidth etwidth. = newwidth. = 30 newwidth 30 newwidth 30 Object and Clae 19 Object and Clae 20
6 Invoking an Intance Method: etwidth = (,, def etwidth(, newwidth:. = newwidth.etwidth(30 3. Here, nothing i returned a reult of method invocation ince there i no return tatement 30 Object and Clae 21 Define the entire cla cla : def init (, w, h, c:. = w. = c def getwidth(: return. def getheight(: return. def getcolor(: return. def etwidth(, newwidth:. = newwidth def etheight(, newheight:. = newheight def etcolor(, newcolor:. = newcolor return.*. def perimeter(: return 2*(.+. def cale(, factor:. *= factor. *= factor To Notice - All method of the cla have the pecial variable a their firt parameter. - Intance variable are acceed through the pecial variable in all method. - We will normally have one line of pace after each function definition, but here it i omitted due to lack of pace. - Additionally, doctring are miing for the ame reaon. Object and Clae 22 repr method o What happen if you print a object? (try thi in the notebook = (,, o We'd like to control how the object i repreented when diplayed. Thi i done with the repr method o Method name with around them are handled by Python in a pecial way o repr alway take only a an argument and return a tring def repr (: return ' <: {}, : {}, : {}>'.format(.,.,. Object and Clae 23 Now define the cla in the notebook cla : def init (, radiu, : """make a circle with the given radiu and """ def getradiu(: """return radiu of circle""" def getcolor(: """return of circle""" def etradiu(, radiu: """change radiu""" def etcolor(, : """change """ """return area of circle""" def perimeter(: """return perimeter (circumference"" def cale(, factor: """multiply the circle radiu by factor""" def repr (: """tring repreentation of circle""" Object and Clae 24
7 So far in thi lecture: Object are data value with tate (tored in intance variable and behavior (implemented a method. Clae are template for creating object of one kind. Cla definition tart with the keyword cla and all the method included in the body of the cla. To intantiate an object we invoke the contructor, a function with the cla' name, which create a new object intance, invoke init on it, and return the new intance. The firt parameter of a method definition i the pecial variable. Coming up Polymorphim: Code can ue any kind of object with the ame method. Why not dictionarie? Create your own MutableString cla. Inheritance: Clae can inherit method from other clae to hare and reue behavior and code. Object and Clae 25 Big idea #1+2: Abtraction and Modularity for Polymorphim (1 Code that interact with an object by invoking it method can ue any object that provide the right method, regardle of that object' internal. Client hape = [ (2,, (4, 3, "red" ] # totalarea = um([.area( for in hape ] Work for any object with a.area( method that return a number. Contract / API: Method.area( hape radiu 2 Implementation 0 1 cla : return ( math.pi *.radiu**2 4 3 "red" cla : return (. *. Object and Clae 26 Big idea #1+2: Abtraction and Modularity for Polymorphim (2 A well defined abtraction allow multiple implementation. A well defined abtraction make it eay to ue alternative implementation later. Client = ( #.area( Work for any repreentation of. No change needed in client code when implementation change. Contract / API: Method.area( Diameter-baed diam 4 cla : return ( math.pi * (.diam/2**2 Implementation "red" Radiu-baed radiu 2 "red" cla : return ( math.pi *.radiu**2 Object and Clae 27 Why not Dictionarie? One attempt: what if we wih to wap implementation? def makedict(w, h, c: return {'figtype': '', '': w, '': h, '': c} def makedict(r, c: return {'figtype': '', 'radiu': w, '': c} def etwidth(fig, : # call with etwidth(myfig, 3, v. myfig.etwidth(3 if fig['figtype'] == '': return fig[''] = elif fig['figtype'] == '': raie Exception(' doe not upport etwidth' # Add one branch for every type of hape. def area(fig: # call with area(myfig, v. myfig.area( if fig['figtype'] == '': return fig[''] * fig[''] elif fig['figtype'] == '': return math.pi * fig['radiu']**2 # Add one branch for every type of hape. Object and Clae 28
8 Python String are Immutable In [11]: = 'eed' In [12]: [2] = 'n' TypeError: 'tr' object doe not upport item aignment Let Define a Mutable String Cla Create a MutableString cla that upport the following behavior: getting a character at a given index changing a character at a given index to a new value getting the length of the mutable tring revering the mutable tring returning a tring repreentation of the mutable tring We can create new tring that are baed on exiting tring: In [13]: 2 = [:2] + 'n' + [3:] In [14]: 2 Out[14]: 'end' But we cannot modify an exiting tring. Object and Clae 29 = MutableString('deer' deer.length( 4.getchar(3 r.revere( reed.etchar(0, '' eed.etchar(2, 'n' end Object and Clae 30 Mutable String Cla cla MutableString: def init (, data: # make a MutableString def length(: # return number of char def getchar(, index: # return char at index def etchar(, index, c: # change char at index to c def revere(: # revere char of object def repr (: # tring rep of object Big idea #1+2: Abtraction and Modularity upport alternative implementation A well defined abtraction allow multiple implementation. A well defined abtraction make it eay to ue alternative implementation later. Client = MutableString( "hello world".etchar(0, 'c' Work for both implementation of MutableString. Contract / API: Method.area( String-baed MutableString tring "cello world" Implementation Lit-baed MutableString char 'c' 'e' 'l' 'l' 'o' ' ' 'w' 'o' 'r' 'l' 'd' Object and Clae 31 Object and Clae 32
9 Special Syntax & Method Name for Collection Method Python tranlate pecial yntax for familiar collection operator into method name that involve. For example: len(coll coll. len ( coll[index] coll. getitem (index coll[index] = newval coll. etitem (index, newval coll1 + coll2 coll1. add (coll2 elt in coll coll. contain (elt So in MutableString,if we rename length to len, getchar to getitem, and etchar to etitem, we can ue the pecial yntax: = MutableString('deer' print len( [3] = 'p' [3] Object and Clae 33 A hierarchy of figure o Notice that and have: o Method with the ame name but different implementation area, perimeter, cale o Method with the ame name AND the ame implementation getcolor, etcolor o Method that are unique to each cla in name a well a implementation getradiu, getradiu, getwidth, etwidth, getheight, etheight o Thi will be the cae for other figure clae we might define too (Square, Triangle, etc. o How can we follow the DRY (Don't Repeat Your principle? Object and Clae 34 A hierarchy of figure Inheritance Fig Triang Squ Inheritance i a mechanim for abtracting over data and behavior common to different clae When cla B inherit from cla A, cla B acquire all of the attribute (intance variable and method from cla A. New attribute (intance variable and method can be added to B. B i called the child cla or the ubcla. A i called the parent cla or the upercla. Each cla "inherit" all the method of it parent Object and Clae 35 Object and Clae 36
10 Child Clae Squ (quare are a pecific kind of (rectangle cla Squ(: # inherit all method # plu can define extra one def getsidelen(: return. def etsidelen(, idelen:. = idelen. = idelen Abtraction: Uer of Squ doe not need to know that it ue and A ubcla method with the ame name a an inherited upercla method replace or override the inherited method. def init (, idelen, : # ue the contructor. init (, idelen, idelen, Object and Clae 37 Parent Clae and have hared method name and definition cla : cla : def init (, w, h, c:. = w. = c def getwidth(: return. def getheight(: return. def getcolor(: return. def etwidth(, w:. = w def etheight(, h: def etcolor(, c:. = c return.*. def perimeter(: return 2*(.+. def cale(, factor:. *= factor. *= factor def init (, rad, c:.radiu = rad. = c def getradiu(: return.radiu Code in blue how repetition. def getcolor(: return. def etradiu(, rad:.radiu = rad def etcolor(, c:. = c return pi*.radiu**2 def perimeter(: return 2*pi*.radiu def cale(, factor:.radiu *= factor Object and Clae 38 Parent Clae: Define a cla Fig to capture common tate and behavior and will inherit from Fig (ee notebook cla Fig: def init (, :. = def getcolor(: return. def etcolor(, :. = pa def perimeter(: pa def cale(, factor: pa and can now inherit from Fig cla (Fig: def init (, radiu, : Fig. init (,.radiu = radiu # other definition the ame, but no need # to define getcolor and etcolor cla (Fig: def init (,,, : Fig. init (,. = eight # other definition the ame, but no need # to define getcolor and etcolor Object and Clae 39 Object and Clae 40
11 Inheritance: c1graphic Clae are often defined in inheritance hierarchie to maximize haring and reue of behavior (method code. Object and Clae 41 Benefit of Object-Oriented Programming Modularity: Common tate and behavior packaged up Polymorphim: Same method can do different thing for different type of object (e.g., perimeter for Fig Encapulation: Hide detail of how we tore the object' information (e.g., different implementation of MutableString Not actually enforced in Python. Java upport private variable and method that can be ued only within method of the cla. Inheritance: Subclae hare tate and behavior of uperclae (avoiding repetition of code Object and Clae 42
Objects, Classes, and Inheritance
Object, Clae, and Inheritance CS111 Computer Programming Department of Computer Science Welleley College The Big Picture Some paradigm of programming: o Imperative Programming Program pecified by conditional,
More informationA SIMPLE IMPERATIVE LANGUAGE THE STORE FUNCTION NON-TERMINATING COMMANDS
A SIMPLE IMPERATIVE LANGUAGE Eventually we will preent the emantic of a full-blown language, with declaration, type and looping. However, there are many complication, o we will build up lowly. Our firt
More informationLecture Outline. Global flow analysis. Global Optimization. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization
Lecture Outline Global flow analyi Global Optimization Global contant propagation Livene analyi Adapted from Lecture by Prof. Alex Aiken and George Necula (UCB) CS781(Praad) L27OP 1 CS781(Praad) L27OP
More informationRepresentations and Transformations. Objectives
Repreentation and Tranformation Objective Derive homogeneou coordinate tranformation matrice Introduce tandard tranformation - Rotation - Tranlation - Scaling - Shear Scalar, Point, Vector Three baic element
More informationCS201: Data Structures and Algorithms. Assignment 2. Version 1d
CS201: Data Structure and Algorithm Aignment 2 Introduction Verion 1d You will compare the performance of green binary earch tree veru red-black tree by reading in a corpu of text, toring the word and
More informationCORRECTNESS ISSUES AND LOOP INVARIANTS
The next everal lecture 2 Study algorithm for earching and orting array. Invetigate their complexity how much time and pace they take Formalize the notion of average-cae and wort-cae complexity CORRECTNESS
More information1 The secretary problem
Thi i new material: if you ee error, pleae email jtyu at tanford dot edu 1 The ecretary problem We will tart by analyzing the expected runtime of an algorithm, a you will be expected to do on your homework.
More informationLaboratory Exercise 2
Laoratory Exercie Numer and Diplay Thi i an exercie in deigning cominational circuit that can perform inary-to-decimal numer converion and inary-coded-decimal (BCD) addition. Part I We wih to diplay on
More informationMAT 155: Describing, Exploring, and Comparing Data Page 1 of NotesCh2-3.doc
MAT 155: Decribing, Exploring, and Comparing Data Page 1 of 8 001-oteCh-3.doc ote for Chapter Summarizing and Graphing Data Chapter 3 Decribing, Exploring, and Comparing Data Frequency Ditribution, Graphic
More informationJava Object Oriented Design. CSC207 Fall 2014
Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code
More informationNote 2: Transformation (modeling and viewing)
Note : Tranformation (modeling and viewing Reading: tetbook chapter 4 (geometric tranformation and chapter 5 (viewing.. Introduction (model tranformation modeling coordinate modeling tranformation world
More informationLecture 14: Minimum Spanning Tree I
COMPSCI 0: Deign and Analyi of Algorithm October 4, 07 Lecture 4: Minimum Spanning Tree I Lecturer: Rong Ge Scribe: Fred Zhang Overview Thi lecture we finih our dicuion of the hortet path problem and introduce
More informationObject-Oriented Programming Concepts
Object-Oriented Programming Concepts Real world objects include things like your car, TV etc. These objects share two characteristics: they all have state and they all have behavior. Software objects are
More informationES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK
ES05 Analyi and Deign of Engineering Sytem: Lab : An Introductory Tutorial: Getting Started with SIMULINK What i SIMULINK? SIMULINK i a oftware package for modeling, imulating, and analyzing dynamic ytem.
More informationOperational Semantics Class notes for a lecture given by Mooly Sagiv Tel Aviv University 24/5/2007 By Roy Ganor and Uri Juhasz
Operational emantic Page Operational emantic Cla note for a lecture given by Mooly agiv Tel Aviv Univerity 4/5/7 By Roy Ganor and Uri Juhaz Reference emantic with Application, H. Nielon and F. Nielon,
More informationITI Introduction to Computing II
ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 20, 2014 Abstract
More informationITI Introduction to Computing II
ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 21, 2013 Abstract
More informationLaboratory Exercise 2
Laoratory Exercie Numer and Diplay Thi i an exercie in deigning cominational circuit that can perform inary-to-decimal numer converion and inary-coded-decimal (BCD) addition. Part I We wih to diplay on
More informationTopics. Lecture 37: Global Optimization. Issues. A Simple Example: Copy Propagation X := 3 B > 0 Y := 0 X := 4 Y := Z + W A := 2 * 3X
Lecture 37: Global Optimization [Adapted from note by R. Bodik and G. Necula] Topic Global optimization refer to program optimization that encompa multiple baic block in a function. (I have ued the term
More informationSIMIT 7. Component Type Editor (CTE) User manual. Siemens Industrial
SIMIT 7 Component Type Editor (CTE) Uer manual Siemen Indutrial Edition January 2013 Siemen offer imulation oftware to plan, imulate and optimize plant and machine. The imulation- and optimizationreult
More informationChapter 13 Non Sampling Errors
Chapter 13 Non Sampling Error It i a general aumption in the ampling theory that the true value of each unit in the population can be obtained and tabulated without any error. In practice, thi aumption
More informationParameters, UVM, Coverage & Emulation Take Two and Call Me in the Morning
Parameter, UVM, Coverage & Emulation Take Two and Call Me in the Morning Michael Horn Mentor Graphic Corporation Colorado, USA Mike_Horn@mentor.com Bryan Ramirez Mentor Graphic Corporation Colorado, USA
More informationCS1150 Principles of Computer Science Objects and Classes
CS1150 Principles of Computer Science Objects and Classes Yanyan Zhuang Department of Computer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Colorado Springs Object-Oriented Thinking Chapters 1-8
More informationLaboratory Exercise 6
Laboratory Exercie 6 Adder, Subtractor, and Multiplier The purpoe of thi exercie i to examine arithmetic circuit that add, ubtract, and multiply number. Each type of circuit will be implemented in two
More informationEdits in Xylia Validity Preserving Editing of XML Documents
dit in Xylia Validity Preerving diting of XML Document Pouria Shaker, Theodore S. Norvell, and Denni K. Peter Faculty of ngineering and Applied Science, Memorial Univerity of Newfoundland, St. John, NFLD,
More information22. Inheritance. Java. Summer 2008 Instructor: Dr. Masoud Yaghini
22. Inheritance Java Summer 2008 Instructor: Dr. Masoud Yaghini Outline Superclasses and Subclasses Using the super Keyword Overriding Methods The Object Class References Inheritance Object-oriented programming
More informationSIMIT 7. Profinet IO Gateway. User Manual
SIMIT 7 Profinet IO Gateway Uer Manual Edition January 2013 Siemen offer imulation oftware to plan, imulate and optimize plant and machine. The imulation- and optimizationreult are only non-binding uggetion
More informationThe Pyth Language. Administrivia
Administrivia The Pyth Language Lecture 5 Please make sure you have registered your team, created SSH keys as indicated on the admin page, and also have electronically registered with us as well. Prof.
More informationPrograms as Models. Procedural Paradigm. Class Methods. CS256 Computer Science I Kevin Sahr, PhD. Lecture 11: Objects
CS256 Computer Science I Kevin Sahr, PhD Lecture 11: Objects 1 Programs as Models remember: we write programs to solve realworld problems programs act as models of the real-world problem to be solved one
More informationRecall. Key terms. Review. Encapsulation (by getters, setters, properties) OOP Features. CSC148 Intro. to Computer Science
CSC148 Intro. to Computer Science Lecture 3: designing classes, special methods, composition, inheritance, Stack, Sack Amir H. Chinaei, Summer 2016 Office Hours: R 10-12 BA4222 ahchinaei@cs.toronto.edu
More informationSeparating Ownership Topology and Encapsulation with Generic Universe Types
Separating Ownerhip Topology and Encapulation with Generic Univere Type WERNER DIETL, Univerity of Wahington SOPHIA DROSSOPOULOU, Imperial College London PETER MÜLLER, ETH Zurich Ownerhip i a powerful
More informationCS-202 Introduction to Object Oriented Programming
CS-202 Introduction to Object Oriented Programming California State University, Los Angeles Computer Science Department Lecture III Inheritance and Polymorphism Introduction to Inheritance Introduction
More informationShortest Paths Problem. CS 362, Lecture 20. Today s Outline. Negative Weights
Shortet Path Problem CS 6, Lecture Jared Saia Univerity of New Mexico Another intereting problem for graph i that of finding hortet path Aume we are given a weighted directed graph G = (V, E) with two
More information24. Inheritance. Java. Fall 2009 Instructor: Dr. Masoud Yaghini
24. Inheritance Java Fall 2009 Instructor: Dr. Masoud Yaghini Outline Superclasses and Subclasses Using the super Keyword Overriding Methods The Object Class References Superclasses and Subclasses Inheritance
More informationDrawing Lines in 2 Dimensions
Drawing Line in 2 Dimenion Drawing a traight line (or an arc) between two end point when one i limited to dicrete pixel require a bit of thought. Conider the following line uperimpoed on a 2 dimenional
More informationOverview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017
Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable
More informationAdvanced Encryption Standard and Modes of Operation
Advanced Encryption Standard and Mode of Operation G. Bertoni L. Breveglieri Foundation of Cryptography - AES pp. 1 / 50 AES Advanced Encryption Standard (AES) i a ymmetric cryptographic algorithm AES
More informationAnalyzing Hydra Historical Statistics Part 2
Analyzing Hydra Hitorical Statitic Part Fabio Maimo Ottaviani EPV Technologie White paper 5 hnode HSM Hitorical Record The hnode i the hierarchical data torage management node and ha to perform all the
More informationKeywords Cloud Computing, Service Level Agreements (SLA), CloudSim, Monitoring & Controlling SLA Agent, JADE
Volume 5, Iue 8, Augut 2015 ISSN: 2277 128X International Journal of Advanced Reearch in Computer Science and Software Engineering Reearch Paper Available online at: www.ijarce.com Verification of Agent
More informationToday s Outline. CS 561, Lecture 23. Negative Weights. Shortest Paths Problem. The presence of a negative cycle might mean that there is
Today Outline CS 56, Lecture Jared Saia Univerity of New Mexico The path that can be trodden i not the enduring and unchanging Path. The name that can be named i not the enduring and unchanging Name. -
More informationAUTOMATIC TEST CASE GENERATION USING UML MODELS
Volume-2, Iue-6, June-2014 AUTOMATIC TEST CASE GENERATION USING UML MODELS 1 SAGARKUMAR P. JAIN, 2 KHUSHBOO S. LALWANI, 3 NIKITA K. MAHAJAN, 4 BHAGYASHREE J. GADEKAR 1,2,3,4 Department of Computer Engineering,
More informationHow to. write a paper. The basics writing a solid paper Different communities/different standards Common errors
How to write a paper The baic writing a olid paper Different communitie/different tandard Common error Reource Raibert eay My grammar point Article on a v. the Bug in writing Clarity Goal Conciene Calling
More informationInheritance, and Polymorphism.
Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to
More informationData Structures (list, dictionary, tuples, sets, strings)
Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access
More informationComputer Graphics. Transformation
(SBE 36) Dr. Aman Eldeib Spring 2 SBE 36 i a fundamental corner tone of computer graphic and i a central to OpenGL a well a mot other graphic tem.(2d and 3D ) Given an object, tranformation i to change
More informationMaking New instances of Classes
Making New instances of Classes NOTE: revised from previous version of Lecture04 New Operator Classes are user defined datatypes in OOP languages How do we make instances of these new datatypes? Using
More informationSelect Operation (σ) It selects tuples that satisfy the given predicate from a relation (choose rows). Review : RELATIONAL ALGEBRA
Review : RELATIONAL ALGEBRA Relational databae ytem are expected to be equipped with a query language that can ait it uer to query the databae intance. There are two kind of query language relational algebra
More informationOutline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism.
Outline Inheritance Class Extension Overriding Methods Inheritance and Constructors Polymorphism Abstract Classes Interfaces 1 OOP Principles Encapsulation Methods and data are combined in classes Not
More informationCSE 8B Programming Assignments Spring Programming: You will have 5 files all should be located in a dir. named PA3:
PROGRAMMING ASSIGNMENT 3: Read Savitch: Chapter 7 Programming: You will have 5 files all should be located in a dir. named PA3: ShapeP3.java PointP3.java CircleP3.java RectangleP3.java TriangleP3.java
More informationG Programming Languages - Fall 2012
G22.2110-003 Programming Languages - Fall 2012 Lecture 12 Thomas Wies New York University Review Last lecture Modules Outline Classes Encapsulation and Inheritance Initialization and Finalization Dynamic
More informationDelaunay Triangulation: Incremental Construction
Chapter 6 Delaunay Triangulation: Incremental Contruction In the lat lecture, we have learned about the Lawon ip algorithm that compute a Delaunay triangulation of a given n-point et P R 2 with O(n 2 )
More informationProgramming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 43 Dynamic Binding (Polymorphism): Part III Welcome to Module
More informationObject Oriented Programming #10
Object Oriented Programming #10 Serdar ARITAN Biomechanics Research Group, Faculty of Sports Sciences, and Department of Computer Graphics Hacettepe University, Ankara, Turkey 1 Simple programming tasks
More informationGeneric Traverse. CS 362, Lecture 19. DFS and BFS. Today s Outline
Generic Travere CS 62, Lecture 9 Jared Saia Univerity of New Mexico Travere(){ put (nil,) in bag; while (the bag i not empty){ take ome edge (p,v) from the bag if (v i unmarked) mark v; parent(v) = p;
More informationNew Structural Decomposition Techniques for Constraint Satisfaction Problems
New Structural Decompoition Technique for Contraint Satifaction Problem Yaling Zheng and Berthe Y. Choueiry Contraint Sytem Laboratory Univerity of Nebraka-Lincoln Email: yzheng choueiry@ce.unl.edu Abtract.
More informationCISC 1600 Lecture 3.1 Introduction to Processing
CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists
More informationKS3 Maths Assessment Objectives
KS3 Math Aement Objective Tranition Stage 9 Ratio & Proportion Probabilit y & Statitic Appreciate the infinite nature of the et of integer, real and rational number Can interpret fraction and percentage
More informationAbstract Class. Lecture 21. Based on Slides of Dr. Norazah Yusof
Abstract Class Lecture 21 Based on Slides of Dr. Norazah Yusof 1 Abstract Class Abstract class is a class with one or more abstract methods. The abstract method Method signature without implementation
More informationInheritance and Polymorphism
Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg
More informationIterators & Generators
Iterators & Generators Sequences A sequence is something that you can: Index into Get the length of What are some examples of sequences? Sequences We ve been working with sequences all semester! Examples:
More informationCS61A Lecture 15 Object Oriented Programming, Mutable Data Structures. Jom Magrotker UC Berkeley EECS July 12, 2012
CS61A Lecture 15 Object Oriented Programming, Mutable Data Structures Jom Magrotker UC Berkeley EECS July 12, 2012 COMPUTER SCIENCE IN THE NEWS http://www.iospress.nl/ios_news/music to my eyes device converting
More informationCSE 250B Assignment 4 Report
CSE 250B Aignment 4 Report March 24, 2012 Yuncong Chen yuncong@c.ucd.edu Pengfei Chen pec008@ucd.edu Yang Liu yal060@c.ucd.edu Abtract In thi project, we implemented the recurive autoencoder (RAE) a decribed
More informationStructured Programming
CS 170 Java Programming 1 Objects and Variables A Little More History, Variables and Assignment, Objects, Classes, and Methods Structured Programming Ideas about how programs should be organized Functionally
More informationFactor Graphs and Inference
Factor Graph and Inerence Sargur Srihari rihari@cedar.bualo.edu 1 Topic 1. Factor Graph 1. Factor in probability ditribution. Deriving them rom graphical model. Eact Inerence Algorithm or Tree graph 1.
More informationQuadrilaterals. Learning Objectives. Pre-Activity
Section 3.4 Pre-Activity Preparation Quadrilateral Intereting geometric hape and pattern are all around u when we tart looking for them. Examine a row of fencing or the tiling deign at the wimming pool.
More informationWhat are the characteristics of Object Oriented programming language?
What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is
More informationLecture 8: More Pipelining
Overview Lecture 8: More Pipelining David Black-Schaffer davidbb@tanford.edu EE8 Spring 00 Getting Started with Lab Jut get a ingle pixel calculating at one time Then look into filling your pipeline Multiplier
More informationExam 1 Format, Concepts, What you should be able to do, and Sample Problems
CSSE 120 Introduction to Software Development Exam 1 Format, Concepts, What you should be able to do, and Sample Problems Page 1 of 6 Format: The exam will have two sections: Part 1: Paper-and-Pencil o
More informationChapter S:II (continued)
Chapter S:II (continued) II. Baic Search Algorithm Sytematic Search Graph Theory Baic State Space Search Depth-Firt Search Backtracking Breadth-Firt Search Uniform-Cot Search AND-OR Graph Baic Depth-Firt
More informationChapter 9 - Object-Oriented Programming: Polymorphism
Chapter 9 - Object-Oriented Programming: Polymorphism Polymorphism Program in the general Introduction Treat objects in same class hierarchy as if all superclass Abstract class Common functionality Makes
More informationService and Network Management Interworking in Future Wireless Systems
Service and Network Management Interworking in Future Wirele Sytem V. Tountopoulo V. Stavroulaki P. Demeticha N. Mitrou and M. Theologou National Technical Univerity of Athen Department of Electrical Engineering
More informationAn Approach to Buffer Management in Java HPC Messaging
An Approach to Buer Management in Java HPC Meaging Mark Baker, Bryan Carpenter, and Aamir Shai Ditributed Sytem Group, Univerity o Portmouth Abtract. One o the mot challenging apect to deigning a Java
More informationInheritance (Deitel chapter 9)
Inheritance (Deitel chapter 9) 1 2 Plan Introduction Superclasses and Subclasses protected Members Constructors and Finalizers in Subclasses Software Engineering with Inheritance 3 Introduction Inheritance
More informationAn Approach to a Test Oracle for XML Query Testing
An Approach to a Tet Oracle for XML Query Teting Dae S. Kim-Park, Claudio de la Riva, Javier Tuya Univerity of Oviedo Computing Department Campu of Vieque, /n, 33204 (SPAIN) kim_park@li.uniovi.e, claudio@uniovi.e,
More informationelse end while End References
621-630. [RM89] [SK76] Roenfeld, A. and Melter, R. A., Digital geometry, The Mathematical Intelligencer, vol. 11, No. 3, 1989, pp. 69-72. Sklanky, J. and Kibler, D. F., A theory of nonuniformly digitized
More informationETSI TS V ( )
TS 122 153 V14.4.0 (2017-05) TECHNICAL SPECIFICATION Digital cellular telecommunication ytem (Phae 2+) (GSM); Univeral Mobile Telecommunication Sytem (UMTS); LTE; Multimedia priority ervice (3GPP TS 22.153
More informationLecture 10 OOP and VB.Net
Lecture 10 OOP and VB.Net Pillars of OOP Objects and Classes Encapsulation Inheritance Polymorphism Abstraction Classes A class is a template for an object. An object will have attributes and properties.
More informationCOS226 - Spring 2018 Class Meeting # 13 March 26, 2018 Inheritance & Polymorphism
COS226 - Spring 2018 Class Meeting # 13 March 26, 2018 Inheritance & Polymorphism Ibrahim Albluwi Composition A GuitarString has a RingBuffer. A MarkovModel has a Symbol Table. A Symbol Table has a Binary
More information3D SMAP Algorithm. April 11, 2012
3D SMAP Algorithm April 11, 2012 Baed on the original SMAP paper [1]. Thi report extend the tructure of MSRF into 3D. The prior ditribution i modified to atify the MRF property. In addition, an iterative
More informationRuby: Introduction, Basics
Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 3 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie
More informationLecture 19: Subclasses & Inheritance (Chapter 18)
http://www.cs.cornell.edu/courses/cs1110/2018sp Lecture 19: Subclasses & Inheritance (Chapter 18) CS 1110 Introduction to Computing Using Python [E. Andersen, A. Bracy, D. Gries, L. Lee, S. Marschner,
More informationBottom Up parsing. Bottom-up parsing. Steps in a shift-reduce parse. 1. s. 2. np. john. john. john. walks. walks.
Paring Technologie Outline Paring Technologie Outline Bottom Up paring Paring Technologie Paring Technologie Bottom-up paring Step in a hift-reduce pare top-down: try to grow a tree down from a category
More informationExtending Classes (contd.) (Chapter 15) Questions:
Extending Classes (contd.) (Chapter 15) Questions: 1 1. The following C++ program compiles without any problems. When run, it even prints out the hello called for in line (B) of main. But subsequently
More informationChapter 11 Inheritance and Polymorphism. Motivations. Suppose you will define classes to model circles,
Chapter 11 Inheritance and Polymorphism 1 Motivations Suppose you will define classes to model circles, rectangles, and triangles. These classes have many common features. What is the best way to design
More informationMinimum congestion spanning trees in bipartite and random graphs
Minimum congetion panning tree in bipartite and random graph M.I. Otrovkii Department of Mathematic and Computer Science St. John Univerity 8000 Utopia Parkway Queen, NY 11439, USA e-mail: otrovm@tjohn.edu
More informationCISC 3115 TY3. C09a: Inheritance. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 9/20/2018 CUNY Brooklyn College
CISC 3115 TY3 C09a: Inheritance Hui Chen Department of Computer & Information Science CUNY Brooklyn College 9/20/2018 CUNY Brooklyn College 1 Outline Inheritance Superclass/supertype, subclass/subtype
More informationComments are almost like C++
UMBC CMSC 331 Java Comments are almost like C++ The javadoc program generates HTML API documentation from the javadoc style comments in your code. /* This kind of comment can span multiple lines */ //
More informationKey Terms - MinMin, MaxMin, Sufferage, Task Scheduling, Standard Deviation, Load Balancing.
Volume 3, Iue 11, November 2013 ISSN: 2277 128X International Journal of Advanced Reearch in Computer Science and Software Engineering Reearch Paper Available online at: www.ijarce.com Tak Aignment in
More informationxy-monotone path existence queries in a rectilinear environment
CCCG 2012, Charlottetown, P.E.I., Augut 8 10, 2012 xy-monotone path exitence querie in a rectilinear environment Gregory Bint Anil Mahehwari Michiel Smid Abtract Given a planar environment coniting of
More informationPackage sound. R topics documented: November 10, Version Date Title A Sound Interface for R
Verion 1.4.5 Date 2017-11-10 Title A Sound Interface for R Package ound November 10, 2017 Author Matthia Heymann Maintainer Stefan Langenberg Depend R
More informationOn successive packing approach to multidimensional (M-D) interleaving
On ucceive packing approach to multidimenional (M-D) interleaving Xi Min Zhang Yun Q. hi ankar Bau Abtract We propoe an interleaving cheme for multidimenional (M-D) interleaving. To achieved by uing a
More informationObject-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018
Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 4: OO Principles - Polymorphism http://courses.cs.cornell.edu/cs2110/2018su Lecture 3 Recap 2 Good design principles.
More informationc.def (pronounced SEE-def) Language Reference Manual
c.def (pronounced SEE-def) Macromedia Flash TM animation language Language Reference Manual Dennis Rakhamimov (dr524@columbia.edu), Group Leader Eric Poirier (edp29@columbia.edu) Charles Catanach (cnc26@columbia.edu)
More informationObject-oriented Programming. Object-oriented Programming
2014-06-13 Object-oriented Programming Object-oriented Programming 2014-06-13 Object-oriented Programming 1 Object-oriented Languages object-based: language that supports objects class-based: language
More informationFloating Point CORDIC Based Power Operation
Floating Point CORDIC Baed Power Operation Kazumi Malhan, Padmaja AVL Electrical and Computer Engineering Department School of Engineering and Computer Science Oakland Univerity, Rocheter, MI e-mail: kmalhan@oakland.edu,
More informationChapter 10 Inheritance and Polymorphism. Dr. Hikmat Jaber
Chapter 10 Inheritance and Polymorphism Dr. Hikmat Jaber 1 Motivations Suppose you will define classes to model circles, rectangles, and triangles. These classes have many common features. What is the
More informationInheritance and Polymorphism
Inheritance and Polymorphism Dr. M. G. Abbas Malik Assistant Professor Faculty of Computing and IT (North Jeddah Branch) King Abdulaziz University, Jeddah, KSA mgmalik@kau.edu.sa www.sanlp.org/malik/cpit305/ap.html
More informationPython in 10 (50) minutes
Python in 10 (50) minutes https://www.stavros.io/tutorials/python/ Python for Microcontrollers Getting started with MicroPython Donald Norris, McGrawHill (2017) Python is strongly typed (i.e. types are
More informationAbout Python. Python Duration. Training Objectives. Training Pre - Requisites & Who Should Learn Python
About Python Python course is a great introduction to both fundamental programming concepts and the Python programming language. By the end, you'll be familiar with Python syntax and you'll be able to
More informationSIMIT 7. What's New In SIMIT V7.1? Manual
SIMIT 7 What' New In SIMIT V7.1? Manual Edition January 2013 Siemen offer imulation oftware to plan, imulate and optimize plant and machine. The imulation- and optimization-reult are only non-binding uggetion
More information