Examples of Dynamic Binding in.net

Size: px
Start display at page:

Download "Examples of Dynamic Binding in.net"

Transcription

1 Examples of Dynamic Binding in.net Alex Buckley Imperial College London June 00 1 Context-locality of dependencies We produce two strongly named assemblies, Server and Server. Code in Server calls code in Server. We wish to show that if both assemblies are loaded in the second context, then a dependency from one to the other is automatically resolved. Server is built first (producing Server.dll), then Server is built (referencing Server.dll and producing Server.dll). Server.dll and Server.dll exist in separate directories, both unknown to Fusion. Listing 1: Server assembly using System. R e f l e c t i o n ; 4 [ assembly : AssemblyVersion ( ) ] [ assembly : AssemblyKeyFile ( Server. key ) ] 7 p u b l i c c l a s s Server { 8 p u b l i c void UseServer ( ) { 9 Console. WriteLine ( C a l l i n g other s e r v e r ) ; 10 Server other = new Server ( ) ; 11 other. p r i n t ( ) ; 1 } 1 } Listing : Server assembly using System. R e f l e c t i o n ; 4 [ assembly : AssemblyVersion ( ) ] [ assembly : AssemblyKeyFile ( Server. key ) ] 7 p u b l i c c l a s s Server { 8 p u b l i c void p r i n t ( ) { 9 Console. WriteLine ( I am Server ) ; 10 } 11 } The Client class in listing is placed in an assembly that has no static dependencies on the Server or Server assemblies. The LoadFrom statements place both these assemblies in the second context. The different hash codes in the output indicate that the different.dll files are distinct Assembly objects in memory. 1

2 Listing : Dependencies are context-local 1 // Dependencies are context l o c a l using System ; p u b l i c c l a s s C l i e n t { 8 Assembly a = Assembly. LoadFrom (@ c : \ s c e n a r i o 1 \ hidden1 \ Server. d l l ) ; 9 Console. WriteLine ( a+ at +a. Location ) ; 10 Console. WriteLine ( a. GetHashCode ( ) ) ; 11 1 Assembly b = Assembly. LoadFrom (@ c : \ s c e n a r i o 1 \ hidden \ Server. d l l ) ; 1 // Assembly b = Assembly. Load ( Server, Version = , Culture=neutral, PublicKeyToken =4ED1A1ADB ) ; 14 Console. WriteLine ( b+ at +b. Location ) ; 1 Console. WriteLine ( b. GetHashCode ( ) ) ; 1 17 Object o = a. C r e a t e I n s t a n c e ( Server ) ; 18 Type t = o. GetType ( ) ; 19 MethodInfo m = t. GetMethod ( UseServer ) ; 0 m. Invoke ( o, n u l l ) ; 1 } } By indirect invocation at line 0 of the client, code in the Server code is invoked. (We need to use indirect invocation to avoid a static reference to the Server assembly from the Client. Since the Client executable is in the first context, having been loaded by the operating system, it would not be able to use the Server assembly in the second context.) Now, code in the Server assembly (class Server, method UseServer) calls code in the Server assembly. The static dependency that Server has on Server is successfully resolved within the second context. No attempt to load a Server assembly takes place. Listing 4: Output of listing 1 C: \ s c e n a r i o 1 >c l i e n t Server, Version = , Culture=neutral, PublicKeyToken=fc71b7cbb8a9d at c : \ s c e n a r i o 1 \ hidden1 \ s e r v e r. d l l 4 Server, Version = , Culture=neutral, PublicKeyToken=4ed1a1adb at c : \ s c e n a r i o 1 \ hidden \ s e r v e r. d l l C a l l i n g other s e r v e r 7 I am Server Note that if we comment out lines 1 and uncomment line 1 in the Client class, then we see cross-context dependency resolution. Assuming that Server.dll is able to be found (e.g. it is in the same directory as the Client executable), it will be loaded into the first context. The code in the Server assembly, loaded in the second context, is able to call code in the Server assembly, loaded in the first context.

3 Unification This example shows that trying to bind to an arbitrary core assembly results in the bind succeeding, but to the approved core assembly. This program tries to load some unavailable versions of the mscorlib core assembly. Listing : Unification 1 // R e f e r e n c e s to m s c o r l i b are a u t o m a t i c a l l y u n i f i e d using System ; p u b l i c c l a s s C l i e n t { 8 Assembly a = Assembly. Load ( Mscorlib, Version = , Culture=neutral, PublicKeyToken=B77AC194E089 ) ; 9 Console. WriteLine ( a+ at +a. Location ) ; 10 Assembly b = Assembly. Load ( Mscorlib, Version = , Culture=neutral, PublicKeyToken=B77AC194E089 ) ; 11 Console. WriteLine ( b+ at +b. Location ) ; 1 } 1 } Running it on the CLR v , we see unification happening, so only the correctly versioned assembly is loaded. 1 C: \ s c e n a r i o >c l i e n t mscorlib, Version = , Culture=neutral, PublicKeyToken= b77ac194e089 at c : \ windows\ m i c r o s o f t. net \ framework \v \ m s c o r l i b. d l l mscorlib, Version = , Culture=neutral, PublicKeyToken= b77ac194e089 at c : \ windows\ m i c r o s o f t. net \ framework \v \ m s c o r l i b. d l l

4 Casting across assemblies This example shows that casting an object from a class in one assembly, to the same class in another assembly, fails when the assemblies have different versions. We create two assemblies, both called Server.dll, that differ only in their version number. We install both to the GAC. Listing : Server assembly v using System. R e f l e c t i o n ; 4 [ assembly : AssemblyVersion ( ) ] [ assembly : AssemblyKeyFile ( Server. key ) ] 7 p u b l i c c l a s s Server {} Listing 7: Server assembly v using System. R e f l e c t i o n ; 4 [ assembly : AssemblyVersion ( ) ] [ assembly : AssemblyKeyFile ( Server. key ) ] 7 p u b l i c c l a s s Server {} The client loads both assemblies (into the first context), then tries to cast an instance of the Server class from the v assembly, to the Server class from the v assembly. The Client executable statically references v of the Server assembly, due to the instantiation of a Server object at line 8 in listing 8. Listing 8: No casting between assembly versions 1 // A c l a s s isn t compatible with i t s e l f i f i t comes from d i f f e r e n t v e r s i o n o f the same assembly using System ; p u b l i c c l a s s C l i e n t { 8 Server s = new Server ( ) ; 9 Console. WriteLine ( S t a t i c a l l y r e f e r e n c e d Server c l a s s comes from assembly : + s. GetType ( ). Assembly. GetName ( ) + at + s. GetType ( ). Assembly. Location ) ; Assembly a = Assembly. Load ( Server, Version = , Culture=neutral, PublicKeyToken=17aa9acb191 ) ; 1 Object o = a. C r e a t e I n s t a n c e ( Server ) ; 1 Console. WriteLine ( Dynamically r e f e r e n c e d Server c l a s s comes from +o. GetType ( ). Assembly+ at +o. GetType ( ). Assembly. Location ) ; 14 1 // Try c a s t i n g from the Server c l a s s in assembly to the Server c l a s s i n assembly t r y { 17 Server s = ( Server ) o ; 18 } catch ( I nvalidcastexception ex ) { 19 Console. WriteLine ( ex ) ; 4

5 0 } 1 } } The cast fails and a InvalidCastException is thrown. Even though the Server class itself is identical in both the Server and Server assemblies, the fact that the assemblies have different versions is important. 1 C: \ s c e n a r i o >c l i e n t S t a t i c a l l y r e f e r e n c e d Server c l a s s comes from assembly : Server, Version = , Culture=neutral, PublicKeyToken=17aa9acb191 at c : \ windows \ assembly \ gac \ s e r v e r \ aa9acb191 \ s e r v e r. d l l Dynamically r e f e r e n c e d Server c l a s s comes from Server, Version = , Culture=n e u t r a l, PublicKeyToken=17aa9acb191 at c : \ windows\ assembly \ gac \ s e r v e r \ aa9acb191 \ s e r v e r. d l l 4 System. I nvalidcastexception : S p e c i f i e d c a s t i s not v a l i d. at C l i e n t. Main ( S t r i n g [ ] a r g s )

6 4 Casting across contexts This example shows that casting an object from a class in one assembly, to the same class in another assembly, fails when the assemblies are loaded in different contexts. We use the v Server assembly from scenario, and build Server.dll. We install it into the GAC, and also copy it to a directory unavailable to Fusion. Listing 9: Server assembly v using System. R e f l e c t i o n ; 4 [ assembly : AssemblyVersion ( ) ] [ assembly : AssemblyKeyFile ( Server. key ) ] 7 p u b l i c c l a s s Server {} The client references the Server class, so when we build the client executable, we must reference the hidden Server.dll that provides the class. This gives the client executable a static reference to an assembly called Server, of version v Such a reference causes the server to load the Server.dll assembly in the GAC. This assembly goes into the first context. The client also loads the hidden Server.dll via LoadFrom, so the assembly goes into the second context. The client then tries to cast an instance of the Server class from the Server.dll loaded from the filesystem, to the class from the Server.dll loaded from the GAC. Listing 10: No casting across contexts 1 // A c l a s s isn t compatible with i t s e l f i f i t comes from a s s e m b l i e s in d i f f e r e n t c o n t e x t s ( hence t h e i r paths are d i f f e r e n t ) using System ; p u b l i c c l a s s C l i e n t { 8 Server s = new Server ( ) ; 9 Console. WriteLine ( S t a t i c a l l y r e f e r e n c e d Server c l a s s comes from assembly : + s. GetType ( ). Assembly+ at + s. GetType ( ). Assembly. Location ) ; Assembly a = Assembly. LoadFrom (@ C: \ s c e n a r i o 4 \ hidden \ Server. d l l ) ; 1 Object o = a. C r e a t e I n s t a n c e ( Server ) ; 1 Console. WriteLine ( Dynamically r e f e r e n c e d Server c l a s s comes from assembly : + o. GetType ( ). Assembly+ at +o. GetType ( ). Assembly. Location ) ; 14 1 // Try c a s t i n g from the Server c l a s s in the LoadFrom context to the Server c l a s s in the Load context 1 t r y { 17 Server s = ( Server ) o ; 18 } catch ( I nvalidcastexception ex ) { 19 Console. WriteLine ( ex ) ; 0 } 1 } } Since the assemblies that declare Server classes are in different contexts, the cast fails, even though the Server classes are identical. (Indeed, the assemblies themselves are identical; only their location, and hence context, is different.)

7 1 C: \ s c e n a r i o 4 >c l i e n t S t a t i c a l l y r e f e r e n c e d Server c l a s s comes from assembly : Server, Version = , Culture=neutral, PublicKeyToken=17aa9acb191 at c : \ windows \ assembly \ gac \ s e r v e r \ aa9acb191 \ s e r v e r. d l l Dynamically r e f e r e n c e d Server c l a s s comes from assembly : Server, Version = , Culture=neutral, PublicKeyToken=17aa9acb191 at c : \ s c e n a r i o 4 \ hidden \ s e r v e r. d l l 4 System. I nvalidcastexception : S p e c i f i e d c a s t i s not v a l i d. at C l i e n t. Main ( S t r i n g [ ] a r g s ) 7

8 LoadFrom reuses assemblies This example shows that LoadFrom has the surprising behaviour that it does not always load the assembly specified. We use the v Server assembly from scenario. We copy it to two different locations, both unavailable to Fusion. The client then uses LoadFrom to attempt to load both files. Listing 11: LoadFrom reuses assemblies 1 // In the LoadFrom context, l o a d i n g the same assembly from d i f f e r e n t l o c a t i o n s r e u s e s the f i r s t one loaded using System ; p u b l i c c l a s s C l i e n t { 8 Assembly a = Assembly. LoadFrom (@ C: \ s c e n a r i o \ hidden1 \ Server. d l l ) ; 9 Console. WriteLine ( a+ at +a. Location ) ; 10 Console. WriteLine ( a. GetHashCode ( ) ) ; 11 1 Assembly b = Assembly. LoadFrom (@ C: \ s c e n a r i o \ hidden \ Server. d l l ) ; 1 Console. WriteLine ( b+ at +b. Location ) ; 14 Console. WriteLine ( b. GetHashCode ( ) ) ; 1 1 AppDomain currentdomain = AppDomain. CurrentDomain ; 17 Assembly [ ] assems = currentdomain. GetAssemblies ( ) ; 18 f o r e a c h ( Assembly assem in assems ) Console. WriteLine ( Loaded : + assem + +assem. Location ) ; 19 } 0 } However, since the assembly s strong name is identical in both locations, the second LoadFrom merely receives the same Assembly object as the first (evidenced by the same hash code, ). For good measure, the client prints out all assemblies loaded in the appdomain, regardless of context. We see that only one Server assembly is loaded, namely the first. 1 C: \ s c e n a r i o >c l i e n t Server, Version = , Culture=neutral, PublicKeyToken=17aa9acb191 at c : \ s c e n a r i o \ hidden1 \ s e r v e r. d l l 4 Server, Version = , Culture=neutral, PublicKeyToken=17aa9acb191 at c : \ s c e n a r i o \ hidden1 \ s e r v e r. d l l Loaded : mscorlib, Version = , Culture=neutral, PublicKeyToken= b77ac194e089 c : \ windows\ m i c r o s o f t. net \ framework \v \ m s c o r l i b. d l l 7 Loaded : Client, Version = , Culture=neutral, PublicKeyToken=n u l l C: \ s c e n a r i o \ C l i e n t. exe 8 Loaded : Server, Version = , Culture=neutral, PublicKeyToken=17 aa9acb191 c : \ s c e n a r i o \ hidden1 \ s e r v e r. d l l 8

More About Methods. Hsuan-Tien Lin. Deptartment of CSIE, NTU. OOP Class, March 8-9, 2010

More About Methods. Hsuan-Tien Lin. Deptartment of CSIE, NTU. OOP Class, March 8-9, 2010 More About Methods Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 8-9, 2010 H.-T. Lin (NTU CSIE) More About Methods OOP 03/08-09/2010 0 / 24 Methods: the Basic Method (1/2, Callee s View) 1 p

More information

Voortgezet Programmeren

Voortgezet Programmeren Voortgezet Programmeren Lecture 4: Interfaces and polymorphism Tommi Tervonen Econometric Institute, Erasmus School of Economics Rule #1: never duplicate code p u b l i c c l a s s Course { p u b l i c

More information

Techniques of Java Programming

Techniques of Java Programming Legi-Nr.:... Techniques of Java Programming ETH Zurich Date: 9 May 008 Family name, first name:... Student number:... I confirm with my signature, that I was able to take this exam under regular circumstances

More information

Laboratory Exercise #8 Introduction to Sequential Logic

Laboratory Exercise #8 Introduction to Sequential Logic Laboratory Exercise #8 Introduction to Sequential Logic ECEN 248: Introduction to Digital Design Department of Electrical and Computer Engineering Texas A&M University 2 Laboratory Exercise #8 1 Introduction

More information

Design Patterns and Refactoring

Design Patterns and Refactoring Singleton Oliver Haase HTWG Konstanz 1 / 19 Description I Classification: object based creational pattern Puropse: ensure that a class can be instantiated exactly once provide global access point to single

More information

ISSP User Guide CY3207ISSP. Revision C

ISSP User Guide CY3207ISSP. Revision C CY3207ISSP ISSP User Guide Revision C Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intnl): 408.943.2600 http://www.cypress.com Copyrights Copyrights

More information

An easy-to-use application that lets end users prepare and deploy background maps to your Carmenta based applications.

An easy-to-use application that lets end users prepare and deploy background maps to your Carmenta based applications. Introducing Carmenta Map Builder An easy-to-use application that lets end users prepare and deploy background maps to your Carmenta based applications. Carmenta s geospatial technology is known for its

More information

Patrol: Revealing Zero-day Attack Paths through Network-wide System Object Dependencies

Patrol: Revealing Zero-day Attack Paths through Network-wide System Object Dependencies Patrol: Revealing Zero-day Attack Paths through Network-wide System Object Dependencies Jun Dai, Xiaoyan Sun, and Peng Liu College of Information Sciences and Technology Pennsylvania State University,

More information

Standards-Based Quantification in DTSA-II Part II

Standards-Based Quantification in DTSA-II Part II Standards-Based Quantification in DTSA-II Part II Nicholas W.M. Ritchie National Institute of Standards and Technology, Gaithersburg, MD 20899-8371 nicholas.ritchie@nist.gov Introduction This article is

More information

SV6: Polynomial Regression and Neural Networks

SV6: Polynomial Regression and Neural Networks Signal and Information Processing Laboratory Institut für Signal- und Informationsverarbeitung Fachpraktikum Signalverarbeitung SV6: Polynomial Regression and Neural Networks 1 Introduction Consider the

More information

Laboratory Exercise #10 An Introduction to High-Speed Addition

Laboratory Exercise #10 An Introduction to High-Speed Addition Laboratory Exercise #10 An Introduction to High-Speed Addition ECEN 248: Introduction to Digital Design Department of Electrical and Computer Engineering Texas A&M University 2 Laboratory Exercise #10

More information

OBEUS. (Object-Based Environment for Urban Simulation) Shareware Version. Itzhak Benenson 1,2, Slava Birfur 1, Vlad Kharbash 1

OBEUS. (Object-Based Environment for Urban Simulation) Shareware Version. Itzhak Benenson 1,2, Slava Birfur 1, Vlad Kharbash 1 OBEUS (Object-Based Environment for Urban Simulation) Shareware Version Yaffo model is based on partition of the area into Voronoi polygons, which correspond to real-world houses; neighborhood relationship

More information

Basic Java OOP 10/12/2015. Department of Computer Science & Information Engineering. National Taiwan University

Basic Java OOP 10/12/2015. Department of Computer Science & Information Engineering. National Taiwan University Basic Java OOP 10/12/2015 Hsuan-Tien Lin ( 林軒田 ) htlin@csie.ntu.edu.tw Department of Computer Science & Information Engineering National Taiwan University ( 國立台灣大學資訊工程系 ) Hsuan-Tien Lin (NTU CSIE) Basic

More information

It s about time... The only timeline tool you ll ever need!

It s about time... The only timeline tool you ll ever need! It s about time... The only timeline tool you ll ever need! Introduction about me Jon Tomczak Senior Consultant Crypsis Game Dev turned Forensicator Past: Started TZWorks in 2006 Consultant at Mandiant

More information

COMS 6100 Class Notes

COMS 6100 Class Notes COMS 6100 Class Notes Daniel Solus September 20, 2016 1 General Remarks The Lecture notes submitted by the class have been very good. Integer division seemed to be a common oversight when working the Fortran

More information

CIS 4930/6930: Principles of Cyber-Physical Systems

CIS 4930/6930: Principles of Cyber-Physical Systems CIS 4930/6930: Principles of Cyber-Physical Systems Chapter 11 Scheduling Hao Zheng Department of Computer Science and Engineering University of South Florida H. Zheng (CSE USF) CIS 4930/6930: Principles

More information

AAG TPoint Mapper (Version 1.40)

AAG TPoint Mapper (Version 1.40) AAG TPoint Mapper (Version 1.40) AAG_TPointMapper works together with Maxim DL, Pinpoint, TheSky6 and TPoint to automate the process of building a TPoint model for a GOTO telescope connected to TheSky6.

More information

Databases. DBMS Architecture: Hashing Techniques (RDBMS) and Inverted Indexes (IR)

Databases. DBMS Architecture: Hashing Techniques (RDBMS) and Inverted Indexes (IR) Databases DBMS Architecture: Hashing Techniques (RDBMS) and Inverted Indexes (IR) References Hashing Techniques: Elmasri, 7th Ed. Chapter 16, section 8. Cormen, 3rd Ed. Chapter 11. Inverted indexing: Elmasri,

More information

On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work

On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work Lab 5 : Linking Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1 Objective The main objective of this lab is to experiment

More information

Configuring LDAP Authentication in iway Service Manager

Configuring LDAP Authentication in iway Service Manager Configuring LDAP Authentication in iway Service Manager LDAP authentication in iway Service Manager (ism) allows ism to authenticate against LDAP and associate an LDAP ism role to the user. ism includes

More information

Inheritance and polymorphism

Inheritance and polymorphism Linköpings Universitet Institutionen för datavetenskap (IDA) UPP-gruppen 2015-11-16 Inheritance and polymorphism Aim In this laboration you will create an object-oriented framework to build (in C++ source-code)

More information

6.842 Randomness and Computation Lecture 5

6.842 Randomness and Computation Lecture 5 6.842 Randomness and Computation 2012-02-22 Lecture 5 Lecturer: Ronitt Rubinfeld Scribe: Michael Forbes 1 Overview Today we will define the notion of a pairwise independent hash function, and discuss its

More information

Tutorial 11. Use of User-Defined Scalars and User-Defined Memories for Modeling Ohmic Heating

Tutorial 11. Use of User-Defined Scalars and User-Defined Memories for Modeling Ohmic Heating Tutorial 11. Use of User-Defined Scalars and User-Defined Memories for Modeling Ohmic Heating Introduction The purpose of this tutorial is to illustrate the use of user-defined scalars (UDS) and user defined

More information

md5bloom: Forensic Filesystem Hashing Revisited

md5bloom: Forensic Filesystem Hashing Revisited DIGITAL FORENSIC RESEARCH CONFERENCE md5bloom: Forensic Filesystem Hashing Revisited By Vassil Roussev, Timothy Bourg, Yixin Chen, Golden Richard Presented At The Digital Forensic Research Conference DFRWS

More information

Hash tables. Hash tables

Hash tables. Hash tables Dictionary Definition A dictionary is a data-structure that stores a set of elements where each element has a unique key, and supports the following operations: Search(S, k) Return the element whose key

More information

EXPERIMENT 7: ANGULAR KINEMATICS AND TORQUE (V_3)

EXPERIMENT 7: ANGULAR KINEMATICS AND TORQUE (V_3) TA name Lab section Date TA Initials (on completion) Name UW Student ID # Lab Partner(s) EXPERIMENT 7: ANGULAR KINEMATICS AND TORQUE (V_3) 121 Textbook Reference: Knight, Chapter 13.1-3, 6. SYNOPSIS In

More information

Petrel TIPS&TRICKS from SCM

Petrel TIPS&TRICKS from SCM Petrel TIPS&TRICKS from SCM Knowledge Worth Sharing Fault Model Quality Control Most Petrel projects are faulted. This means that fault models must be built and then checked for accuracy in almost every

More information

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University Prof. Sunil P. Khatri Lab exercise created and tested by: Abbas Fairouz, Ramu Endluri, He Zhou,

More information

Hash tables. Hash tables

Hash tables. Hash tables Dictionary Definition A dictionary is a data-structure that stores a set of elements where each element has a unique key, and supports the following operations: Search(S, k) Return the element whose key

More information

ITI Introduction to Computing II

ITI Introduction to Computing II (with contributions from R. Holte) School of Electrical Engineering and Computer Science University of Ottawa Version of January 11, 2015 Please don t print these lecture notes unless you really need to!

More information

Numerical solution of the time-independent 1-D Schrödinger equation. Matthias E. Möbius. September 24, 2010

Numerical solution of the time-independent 1-D Schrödinger equation. Matthias E. Möbius. September 24, 2010 Numerical solution of the time-independent 1-D Schrödinger equation Matthias E. Möbius September 24, 2010 1 Aim of the computational lab Numerical solution of the one-dimensional stationary Schrödinger

More information

Week 4: Hopfield Network

Week 4: Hopfield Network Week 4: Hopfield Network Phong Le, Willem Zuidema November 20, 2013 Last week we studied multi-layer perceptron, a neural network in which information is only allowed to transmit in one direction (from

More information

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University Prof. Sunil P Khatri (Lab exercise created and tested by Ramu Endluri, He Zhou and Sunil P

More information

A First Course on Kinetics and Reaction Engineering Example S6.2

A First Course on Kinetics and Reaction Engineering Example S6.2 Example S6.2 Problem Purpose This example illustrates the use of the MATLAB template file SolvBVDifS.m to solve a second order boundary value ordinary differential equation with a singularity at the boundary

More information

Computer Science Introductory Course MSc - Introduction to Java

Computer Science Introductory Course MSc - Introduction to Java Computer Science Introductory Course MSc - Introduction to Java Lecture 3:,, Pablo Oliveira ENST Outline 1 2 3 Definition An exception is an event that indicates an abnormal condition

More information

Week 5: The Backpropagation Algorithm

Week 5: The Backpropagation Algorithm Week 5: The Backpropagation Algorithm Hans Georg Schaathun 25th April 2017 Time Topic Reading 8.15- Recap of tutorials last week Lecture: From perceptron to back-propagation Marsland Section 4 9.00- Tutorial

More information

Foundations of Computation

Foundations of Computation The Australian National University Semester 2, 2018 Research School of Computer Science Tutorial 1 Dirk Pattinson Foundations of Computation The tutorial contains a number of exercises designed for the

More information

Title. Syntax. Description. Options. stata.com. forecast estimates Add estimation results to a forecast model

Title. Syntax. Description. Options. stata.com. forecast estimates Add estimation results to a forecast model Title stata.com forecast estimates Add estimation results to a forecast model Syntax Description Options Remarks and examples References Also see Syntax Add estimation result currently in memory to model

More information

APBS electrostatics in VMD - Software. APBS! >!Examples! >!Visualization! >! Contents

APBS electrostatics in VMD - Software. APBS! >!Examples! >!Visualization! >! Contents Software Search this site Home Announcements An update on mailing lists APBS 1.2.0 released APBS 1.2.1 released APBS 1.3 released New APBS 1.3 Windows Installer PDB2PQR 1.7.1 released PDB2PQR 1.8 released

More information

Local stageout update

Local stageout update Local stageout update Subir Sarkar, Frank Würthwein, Johannes Mülmenstädt August 9, 2010 Big picture Local stageout requires the following pieces to be viable end-to-end: CRAB support (see Subir 7/26/2010)

More information

Analyzing Contention and Backoff in Asynchronous Shared Memory

Analyzing Contention and Backoff in Asynchronous Shared Memory Analyzing Contention and Backoff in Asynchronous Shared Memory ABSTRACT Naama Ben-David Carnegie Mellon University nbendavi@cs.cmu.edu Randomized backoff protocols have long been used to reduce contention

More information

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University Prof. Mi Lu TA: Ehsan Rohani Laboratory Exercise #4 MIPS Assembly and Simulation

More information

M etodos Matem aticos e de Computa c ao I

M etodos Matem aticos e de Computa c ao I Métodos Matemáticos e de Computação I Complex Systems 01/16 General structure Microscopic scale Individual behavior Description of the constituents Model Macroscopic scale Collective behavior Emergence

More information

Shipyard Work Center Performance Analysis

Shipyard Work Center Performance Analysis Shipyard Work Center Performance Analysis PERCEPTION Helping The Shipyard Improve Productivity A Training Tutorial 1 PERCEPTION compiles shipyard production information and generates concise reports on

More information

More on Methods and Encapsulation

More on Methods and Encapsulation More on Methods and Encapsulation Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 31, 2009 H.-T. Lin (NTU CSIE) More on Methods and Encapsulation OOP(even) 03/31/2009 0 / 38 Local Variables Local

More information

Traffic Simulation Toolbox User s Manual

Traffic Simulation Toolbox User s Manual User s Manual Jesse Haber-Kucharsky Shreyas Sundaram University of Waterloo Department of Electrical and Computer Engineering May 31, 2011 Contents 1 Introduction 1 2 Basic Use 2 2.1 Quick-Start Example.......................

More information

A First Course on Kinetics and Reaction Engineering Example S5.1

A First Course on Kinetics and Reaction Engineering Example S5.1 Example S5.1 Problem Purpose This example illustrates the use of the MATLAB template file SolvBVDif.m to solve a second order boundary value ordinary differential equation. Problem Statement Solve the

More information

Assignment 3 Logic and Reasoning KEY

Assignment 3 Logic and Reasoning KEY Assignment 3 Logic and Reasoning KEY Print this sheet and fill in your answers. Please staple the sheets together. Turn in at the beginning of class on Friday, September 8. Recall this about logic: Suppose

More information

2 Prediction and Analysis of Variance

2 Prediction and Analysis of Variance 2 Prediction and Analysis of Variance Reading: Chapters and 2 of Kennedy A Guide to Econometrics Achen, Christopher H. Interpreting and Using Regression (London: Sage, 982). Chapter 4 of Andy Field, Discovering

More information

ITI Introduction to Computing II

ITI Introduction to Computing II (with contributions from R. Holte) School of Electrical Engineering and Computer Science University of Ottawa Version of January 9, 2019 Please don t print these lecture notes unless you really need to!

More information

Constructing Potential Energy Diagrams

Constructing Potential Energy Diagrams potential ENERGY diagrams Visual Quantum Mechanics Teac eaching Guide ACTIVITY 2 Constructing Potential Energy Diagrams Goal In this activity, you will explore energy diagrams for magnets in repulsive

More information

The Maths Inside project

The Maths Inside project mathematics promotion unit de morgan house 57-58 russell square london wc1b 4hs The Maths Inside project How often do we read that maths is in everything in the world around us or maths affects everything

More information

In-System Serial Programming (ISSP) Guide

In-System Serial Programming (ISSP) Guide CY3207ISSP In-System Serial Programming (ISSP) Guide Spec. # 001-15301 Rev. ** Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intnl): 408.943.2600 http://www.cypress.com

More information

Lecture: Analysis of Algorithms (CS )

Lecture: Analysis of Algorithms (CS ) Lecture: Analysis of Algorithms (CS483-001) Amarda Shehu Spring 2017 1 Outline of Today s Class 2 Choosing Hash Functions Universal Universality Theorem Constructing a Set of Universal Hash Functions Perfect

More information

PHP-Einführung - Lesson 4 - Object Oriented Programming. Alexander Lichter June 27, 2017

PHP-Einführung - Lesson 4 - Object Oriented Programming. Alexander Lichter June 27, 2017 PHP-Einführung - Lesson 4 - Object Oriented Programming Alexander Lichter June 27, 2017 Content of this lesson 1. Recap 2. Why OOP? 3. Git gud - PHPStorm 4. Include and Require 5. Classes and objects 6.

More information

In-System Serial Programming (ISSP) Guide

In-System Serial Programming (ISSP) Guide CY3207ISSP In-System Serial Programming (ISSP) Guide Doc. # 001-15301 Rev. *A Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intnl): 408.943.2600 http://www.cypress.com

More information

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations Lab 2 Worksheet Problems Problem : Geometry and Linear Equations Linear algebra is, first and foremost, the study of systems of linear equations. You are going to encounter linear systems frequently in

More information

Self-healing tile sets: rates of regrowth in damaged assemblies

Self-healing tile sets: rates of regrowth in damaged assemblies University of Arkansas, Fayetteville ScholarWorks@UARK Mathematical Sciences Undergraduate Honors Theses Mathematical Sciences 5-2015 Self-healing tile sets: rates of regrowth in damaged assemblies Kevin

More information

UML. Design Principles.

UML. Design Principles. .. Babes-Bolyai University arthur@cs.ubbcluj.ro November 20, 2018 Overview 1 2 3 Diagrams Unified Modeling Language () - a standardized general-purpose modeling language in the field of object-oriented

More information

Advanced Topics in LP and FP

Advanced Topics in LP and FP Lecture 3: Logic Programming in Prolog Outline 1 2 3 The control of execution Logic Programming Declarative programming style: Emphasis on What is the solution? instead of How to find the solution? Symbolic

More information

Class versus Instance (Section 5.1)

Class versus Instance (Section 5.1) Class versus Instance (Section 5.1) Hsuan-Tien Lin Department of CSIE, NTU OOP Class, March 22-23, 2010 H.-T. Lin (NTU CSIE) Class versus Instance OOP 03/22-23/2010 0 / 16 Static Variables (1/2) 1 class

More information

Hash tables. Hash tables

Hash tables. Hash tables Basic Probability Theory Two events A, B are independent if Conditional probability: Pr[A B] = Pr[A] Pr[B] Pr[A B] = Pr[A B] Pr[B] The expectation of a (discrete) random variable X is E[X ] = k k Pr[X

More information

10:00 12:30. Do not open this problem booklet until the start of the examination is announced.

10:00 12:30. Do not open this problem booklet until the start of the examination is announced. 21 I 20 8 26 10:00 12:30 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 4.. Answer the following 4 problems. Use the designated answer sheet for each problem.

More information

Parallelization of the QC-lib Quantum Computer Simulator Library

Parallelization of the QC-lib Quantum Computer Simulator Library Parallelization of the QC-lib Quantum Computer Simulator Library Ian Glendinning and Bernhard Ömer VCPC European Centre for Parallel Computing at Vienna Liechtensteinstraße 22, A-19 Vienna, Austria http://www.vcpc.univie.ac.at/qc/

More information

Esri Production Mapping: An Introduction

Esri Production Mapping: An Introduction Esri Production Mapping: An Introduction Amber Bethell & Joseph Sheffield Esri UC 2014 Technical Workshop Your organization s processes Collect Share Manage Produce Your organization s needs Standardization

More information

AspenTech: VAPOR PRESSURES

AspenTech: VAPOR PRESSURES AspenTech: VAPOR PRESSURES Technical Memo No. XX-1 Subject: Vapor pressure interpolation error analysis To: Ms. Sam K. Safobeen Submitted by: Student 2 Date: May 11, 2010 Summary: I have compiled vapor

More information

CSE 150. Assignment 6 Summer Maximum likelihood estimation. Out: Thu Jul 14 Due: Tue Jul 19

CSE 150. Assignment 6 Summer Maximum likelihood estimation. Out: Thu Jul 14 Due: Tue Jul 19 SE 150. Assignment 6 Summer 2016 Out: Thu Jul 14 ue: Tue Jul 19 6.1 Maximum likelihood estimation A (a) omplete data onsider a complete data set of i.i.d. examples {a t, b t, c t, d t } T t=1 drawn from

More information

Model Building An Introduction to Atomistic Simulation

Model Building An Introduction to Atomistic Simulation Materials and Modelling MPhil 2006-07 COURSE MP3: MONTE CARLO AND MOLECULAR DYNAMICS COMPUTING CLASS 1 Model Building An Introduction to Atomistic Simulation Wednesday 22 nd November 2006 14.00 16.00 1

More information

Integration using Gaussian Quadrature

Integration using Gaussian Quadrature Integration using Gaussian Quadrature Tutorials November 25, 2017 Department of Aeronautics, Imperial College London, UK Scientific Computing and Imaging Institute, University of Utah, USA 2 Chapter 1

More information

Calculations to predict motion or move objects (done repetitively in a loop)

Calculations to predict motion or move objects (done repetitively in a loop) Lab 2: Free Fall 1 Modeling Free Fall Now that you ve done experimental measurements of an object in free fall, you will model the motion of an object in free fall using numerical methods and compare your

More information

Introduction to functions

Introduction to functions Introduction to functions Comp Sci 1570 Introduction to C++ Outline 1 2 Functions A function is a reusable sequence of s designed to do a particular job. In C++, a function is a group of s that is given

More information

In a five-minute period, you get a certain number m of requests. Each needs to be served from one of your n servers.

In a five-minute period, you get a certain number m of requests. Each needs to be served from one of your n servers. Suppose you are a content delivery network. In a five-minute period, you get a certain number m of requests. Each needs to be served from one of your n servers. How to distribute requests to balance the

More information

CSE 502 Class 11 Part 2

CSE 502 Class 11 Part 2 CSE 502 Class 11 Part 2 Jeremy Buhler Steve Cole February 17 2015 Today: analysis of hashing 1 Constraints of Double Hashing How does using OA w/double hashing constrain our hash function design? Need

More information

Pinned Truss Freebody Diagram (FBD) Blog Post pdf

Pinned Truss Freebody Diagram (FBD) Blog Post pdf Pinned Truss Freebody Diagram (FBD) Blog Post pdf Author: Surya Batchu Senior Stress Engineer Founder, STRESS EBOOK LLC. http://www.stressebook.com 1 P a g e Freebody Diagram (FBD) of a Pinned Truss In

More information

Projects and Investigations to accompany Mathematics for Electrical Engineering and Computing

Projects and Investigations to accompany Mathematics for Electrical Engineering and Computing Projects and Investigations to accompany Mathematics for Electrical Engineering and Computing Investigation 1 An investigation of the number 'e' Introduction An important equation which describes many

More information

UNIVERSITY OF CALIFORNIA

UNIVERSITY OF CALIFORNIA UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences Last modified on April 14, 2004 by Brian Leibowitz (bsl@eecs.berkeley.edu) Jan Rabaey Homework

More information

LightWork Memo 18: Galactic Spectra Data Overview 1

LightWork Memo 18: Galactic Spectra Data Overview 1 LightWork Memo 18: Galactic Spectra Data Overview 1 Subject: Galactic Spectra Data Overview Memo: 18, revision 1 From: Glen Langston, Evan Smith and Sophie Knudsen Date: 2017 August 18 Summary: Examples

More information

FODO Cell Introduction to OptiM

FODO Cell Introduction to OptiM FODO Cell Introduction to OptiM S. Alex Bogacz Jefferson Lab 1 FODO Optics cell Most accelerator lattices are designed in modular ways Design and operational clarity, separation of functions One of the

More information

EXAMPLES 4/12/2018. The MIPS Pipeline. Hazard Summary. Show the pipeline diagram. Show the pipeline diagram. Pipeline Datapath and Control

EXAMPLES 4/12/2018. The MIPS Pipeline. Hazard Summary. Show the pipeline diagram. Show the pipeline diagram. Pipeline Datapath and Control The MIPS Pipeline CSCI206 - Computer Organization & Programming Pipeline Datapath and Control zybook: 11.6 Developed and maintained by the Bucknell University Computer Science Department - 2017 Hazard

More information

Improving the Testing Rate of Electronic Circuit Boards

Improving the Testing Rate of Electronic Circuit Boards Electronic Circuit August 19, 2011 Problem statement Acculogic Inc. manufactures systems for testing (ECBs). The systems are almost entirely automatic but require some human input. The clients of Acculogic

More information

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation Viveck R. Cadambe EE Department, Pennsylvania State University, University Park, PA, USA viveck@engr.psu.edu Nancy Lynch

More information

CS Homework 3. October 15, 2009

CS Homework 3. October 15, 2009 CS 294 - Homework 3 October 15, 2009 If you have questions, contact Alexandre Bouchard (bouchard@cs.berkeley.edu) for part 1 and Alex Simma (asimma@eecs.berkeley.edu) for part 2. Also check the class website

More information

Extending Oblivious Transfers Efficiently

Extending Oblivious Transfers Efficiently Extending Oblivious Transfers Efficiently Yuval Ishai Technion Joe Kilian Kobbi Nissim Erez Petrank NEC Microsoft Technion Motivation x y f(x,y) How (in)efficient is generic secure computation? myth don

More information

Engineering for Compatibility

Engineering for Compatibility W17 Compatibility Testing Wednesday, October 3rd, 2018 3:00 PM Engineering for Compatibility Presented by: Melissa Benua mparticle Brought to you by: 350 Corporate Way, Suite 400, Orange Park, FL 32073

More information

Lab 1: Importing Data, Rectification, Datums, Projections, and Coordinate Systems

Lab 1: Importing Data, Rectification, Datums, Projections, and Coordinate Systems Lab 1: Importing Data, Rectification, Datums, Projections, and Coordinate Systems Topics covered in this lab: i. Importing spatial data to TAS ii. Rectification iii. Conversion from latitude/longitude

More information

A First Course on Kinetics and Reaction Engineering Example 1.4

A First Course on Kinetics and Reaction Engineering Example 1.4 Example 1.4 Problem Purpose This example illustrates the process of identifying reactions that are linear combinations of other reactions in a set and eliminating them until a mathematically independent

More information

Transactions on Information and Communications Technologies vol 18, 1998 WIT Press, ISSN

Transactions on Information and Communications Technologies vol 18, 1998 WIT Press,   ISSN GIS in the process of road design N.C. Babic, D. Rebolj & L. Hanzic Civil Engineering Informatics Center, University ofmaribor, Faculty of Civil Engineering, Smetanova 17, 2000 Maribor, Slovenia. E-mail:

More information

Geography 281 Map Making with GIS Project Four: Comparing Classification Methods

Geography 281 Map Making with GIS Project Four: Comparing Classification Methods Geography 281 Map Making with GIS Project Four: Comparing Classification Methods Thematic maps commonly deal with either of two kinds of data: Qualitative Data showing differences in kind or type (e.g.,

More information

Factory method - Increasing the reusability at the cost of understandability

Factory method - Increasing the reusability at the cost of understandability Factory method - Increasing the reusability at the cost of understandability The author Linkping University Linkping, Sweden Email: liuid23@student.liu.se Abstract This paper describes how Bansiya and

More information

So far we have implemented the search for a key by carefully choosing split-elements.

So far we have implemented the search for a key by carefully choosing split-elements. 7.7 Hashing Dictionary: S. insert(x): Insert an element x. S. delete(x): Delete the element pointed to by x. S. search(k): Return a pointer to an element e with key[e] = k in S if it exists; otherwise

More information

Negative Mass as a Driver For Cosmic Inflation, Dark Energy and Dark Matter

Negative Mass as a Driver For Cosmic Inflation, Dark Energy and Dark Matter Negative Mass as a Driver For Cosmic Inflation, Dark Energy and Dark Matter Abstract I have conducted n-body simulations of a model universe. Initial conditions include a uniform mix of 4 types of particle:

More information

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages Homework s TM Variants and the Universal TM Homework #6 returned Homework #7 due today Homework #8 (the LAST homework!) Page 262 -- Exercise 10 (build with JFLAP) Page 270 -- Exercise 2 Page 282 -- Exercise

More information

FACTORS AFFECTING CONCURRENT TRUNCATE

FACTORS AFFECTING CONCURRENT TRUNCATE T E C H N I C A L N O T E FACTORS AFFECTING CONCURRENT TRUNCATE DURING BATCH PROCESSES Prepared By David Kurtz, Go-Faster Consultancy Ltd. Technical Note Version 1.00 Thursday 2 April 2009 (E-mail: david.kurtz@go-faster.co.uk,

More information

Writing Bots for Maize

Writing Bots for Maize Writing Bots for Maize Stephen Wattam November 1, 2012 Contents 1 Introduction 2 2 World Format 2 3 Bot API 2 3.1 Bot Data Format.................................... 3 3.2 Alternative Interfaces to Bot.............................

More information

Leveraging Your Geo-spatial Data Investments with Quantum GIS: an Open Source Geographic Information System

Leveraging Your Geo-spatial Data Investments with Quantum GIS: an Open Source Geographic Information System Leveraging Your Geo-spatial Data Investments with Quantum GIS: an Open Source Geographic Information System Donald L. Schrupp Colorado Division of Wildlife (Retired) Danny Lewis Texas Parks and Wildlife

More information

MontePython Exercises IFT School on Cosmology Tools

MontePython Exercises IFT School on Cosmology Tools MontePython Exercises IFT School on Cosmology Tools Miguel Zumalacarregui March 16, 2017 The exercises have been ranked by level of difficulty (boring = v, interesting = challenging = and whether they

More information

Insert Sorted List Insert as the Last element (the First element?) Delete Chaining. 2 Slide courtesy of Dr. Sang-Eon Park

Insert Sorted List Insert as the Last element (the First element?) Delete Chaining. 2 Slide courtesy of Dr. Sang-Eon Park 1617 Preview Data Structure Review COSC COSC Data Structure Review Linked Lists Stacks Queues Linked Lists Singly Linked List Doubly Linked List Typical Functions s Hash Functions Collision Resolution

More information

SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version

SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version SDS developer guide Develop distributed and parallel applications in Java Nathanaël Cottin sds@ncottin.net http://sds.ncottin.net version 0.0.3 Copyright 2007 - Nathanaël Cottin Permission is granted to

More information

Bloomsburg University Weather Viewer Quick Start Guide. Software Version 1.2 Date 4/7/2014

Bloomsburg University Weather Viewer Quick Start Guide. Software Version 1.2 Date 4/7/2014 Bloomsburg University Weather Viewer Quick Start Guide Software Version 1.2 Date 4/7/2014 Program Background / Objectives: The Bloomsburg Weather Viewer is a weather visualization program that is designed

More information

ArcGIS 9 ArcGIS StreetMap Tutorial

ArcGIS 9 ArcGIS StreetMap Tutorial ArcGIS 9 ArcGIS StreetMap Tutorial Copyright 2001 2008 ESRI All Rights Reserved. Printed in the United States of America. The information contained in this document is the exclusive property of ESRI. This

More information