10.10 Introduction

合集下载

胶囊旅馆创业计划书

胶囊旅馆创业计划书
纷案件,民事案件围绕什么审理?案件争议
焦点。一般来说,争议焦点可以用这个格式: 1.原告的起诉是否有法律和事实依据;2.被告 的抗辩是否有法律和事实依据。…… 所以,原
答:沙溢执导的首部电影《亲密的旅行》上 映了,其中沙溢的儿子安吉也在片中当了一 回主演,其实总体表现还是很不错的,并没 有遭到网友的怒斥,网友更多的是赞赏安吉 的表演,因为他在影片中的精彩演出为他圈 了不少的粉,并且很多网友希望安吉以后能 在...答:近日,周杰伦录制节目的视频在网 上疯传,视频中周杰伦因为节目组播放他的 歌影响了嘉宾谈话,语气有些严肃:“人家 来宾在说话,你们放我的音乐,有没有礼貌 啊?”该视频短短几天就引起了一阵疯狂转
03
执行力
以客户为中心,以员工为 本,追求员工、公司、客 户和社会的共赢
经营方针 贯彻企业经营思想,实现经营目标的基本
途径和指导规范,针对某一时期企业所面临 的重要问题而采取的指导性原则。所策划规 定的企业经营方针政策。
10
PART 02
项目介绍
在此录入上述图表的描述说明,在此录入 上述图表的描述说明文字信息。
我们一起创作企业的辉煌,一 起实现我们的理想奋斗。
企业、事业各部门领导人具有合格的管理素质,有战略眼光, 责任心强,,管理部门的工作健全而有效率。
06
项目成员
01
代用名
职位名称
专业技能 办事效率 领导评价
03
代用名
职位名称
专业技能 办事效率 领导评价
65 85 95
95 75
95
02
代用名
职位名称
专业技能 办事效率 领导评价
04
代用名
职位名称
专业技能 办事效率 领导评价

A10_Introduction_to_Column_Buckling

A10_Introduction_to_Column_Buckling

Introduction of Column BucklingStructures subjected to compressive (and other types of loads) may become unstable and buckle. In idealized situations, buckling is the sudden onset of very large displacements at some critical load (generally transverse to the member) and sometimes with a corresponding decrease in load-carrying capacity. In other situations, buckling may occur more gradually; but as the load approaches the critical load displacements will increase at a rapidrate. Below are examples of buckling situations:Consider a column fixed on one end and subjectedto a uniaxial compressive load P. When P is small,the column shortens axially (is compressed).When the axial compressive force P reaches acritical value cr P, the column suddenly experiencesa lateral displacement, i.e., it buckles.A thin, deep cantilever beam is subjected to a vertical end load P. As long as the load P is below a critical value cr P , the beam section remains vertical (motion is downward only) and resists the bending action of P. At the critical value cr P , the beam will twist and bend sideward (out of the vertical plane). The point at which the structure buckles is called an instability point. At or just below the criticalvalue of the load, any small disturbance can cause the structure tochange position as shown in the sketch of P vs. displacement.sideward displacement, twist PcrP P idealized actualA familiar soda can is shown below. When the applied load P is sufficiently small, the vertical wall remains cylindrical and is compressed uniformly in the vertical direction (fig. a).If P becomes toolarge (reaches thecritical value), theposition becomesunstable. A smalldisturbance causesthe vertical walls tobend in and out in acomplex pattern asshown in fig. b(buckling orcrumpling occurs).The top may even rotate relative to the bottom.A somewhat different type of instability is shown below for a shallow curved arch or dome.As the load P is increased, the top of the arch displaces downward in a somewhatlinear fashion (fig. a).However, at some critical value of P, the arch will suddenly snap through to the configuration shown in fig. b. This is called snap buckling . At this critical load, the arch (top) suddenly moves vertically from displacement A to Bwith NO increase in load P.PThe investigation of structural instability and buckling is a difficult subject. We shall consider only the case of the cantilevered column discussed previously. Before considering this stability problem, it is necessary to derive the equations governing the bending of a beam subjected to longitudinal as well as transverse loads. Consider a free-body of a beam with a transverse load q(x) and a constant axial force P as shown below.PPxy()v xM P()p xSumming forces vertically and taking moments about the center of the differential element yields:220()x x V V V p x M M M VV V P v ∆∆+∆-+∆=+∆-+++∆+∆= (10.1)Divide by x ∆ and take the limit 0x ∆→ to obtain00dVp dx dM dv V Pdxdx-=++=(10.2)Assume that the bending moment is responsible for the transverse deformation of the beam; i.e., we will neglect the effect of shear on the deformations (same as ENGR 214 and AERO 304). Then,22d v EI M dx= (10.3)Substituting (10.3) into the moment equation (10.2) gives220d d v dv EI V P dx dx dx ⎛⎫++= ⎪ ⎪⎝⎭ (10.4)Solving (10.4) for V and substituting in the shear equation (10.2) gives2222d d v d dv EI P p dx dx dx dx ⎛⎫⎛⎫+= ⎪ ⎪ ⎪⎝⎭⎝⎭ (10.5)Now consider the cantilevered column with only an axial compressive force P. Boundary conditions for this problem are given by:0 00v at x dv dx =⎫⎪=⎬=⎪⎭0 0M at x L V =⎫=⎬=⎭ (10.6)The boundary conditions at x=L may be expressed in terms of v by substituting the boundary conditions into the second of equations (10.2), and (10.3), into (10.6) to obtain:22220 0d vM EI dx at x L d d v dv V P dx dx dx ⎫==⎪⎪=⎬⎛⎫⎪-=+= ⎪ ⎪⎪⎝⎭⎭(10.7)For constant EI and P, the governing differential equation (10.5) becomes42420d v d v EIPdxdx+= (10.8)We must now find the solution to the differential equation (10.8) subject to the boundary conditions at x=0 [eq. (10.6)] and x=L [eq. (10.7)]. We note that v=0 is a solution for any value of P.However, we are not interested in this trivial solution. The theory of differential equations states that we must have 4 independent constants in the general solution to the differential equation (there are 4 boundary conditions). A possible solution for ()v x is a combination of polynomial and trigonometric terms:1234()sincosv x c c x c c =+++(10.9)You can verify that this assumed solution satisfies the differential equation. Substituting (10.9) into the 4 boundary conditions [2 boundary conditons at x=0 in (10.6) and 2 at x=L in (10.7)] gives the following:142334200sincosc c c c PP c c EI EI c P +=+=--==(10.10)Note that all the right-hand sides are equal to 0; hence, a possible solution is that 12340c c c c ====. In this case, ()0v x = is the solution for equilibrium of the cantilevered column. This would correspond to simple compression of the column with no sideways motion. However, we consider this once again a trivial solution. We need to find another solution!Equations (10.10) are in fact an eigenvalue problem !1234100101000sin cos000cccP PcEI EIP⎡⎤⎢⎥⎧⎫⎧⎫⎢⎥⎪⎪⎪⎪⎢⎥⎪⎪⎪⎪=⎨⎬⎨⎬⎢⎥⎪⎪⎪⎪⎢⎥--⎪⎪⎪⎪⎢⎥⎩⎭⎩⎭⎢⎥⎣⎦(10.11)The solution of the eigenvalue problem requires that the determinant of the 4x4 coefficient matrix by equal to zero which will yield the solution for P satisfying this condition. Note that we will obtain an infinite number of solutions due to the repeating nature of the sin and cos trigonometric functions. An easier approach is as follows. Referring to equation (10.10), the fourth equation implies that 20c= is a possible solution (for 0P≠). With 20c=, the second equation implies that 30c= is a possible solution. The first equation implies that 41c c=-. Hence, the third equation becomes simply:1cos0P c EI= (10.12)The last equation can be satisfied by setting 10c =, which is a trivial solution again, or by having a value of P such thatcos0= (10.13)The smallest value of P satisfying this condition is224EIP L π=(10.14)Substituting this value of P back into ()v x gives1()1cos 2x v x c L π⎛⎫=- ⎪⎝⎭(10.15)Hence, we have found the critical value of P, and the shape that the beam bends into for this critical load. Note that the value of 1ccannot be determined. This is the nature of an eigenvalue problem. Since the solution of an eigenvalue problem requires that we force the determinant of the coefficient matrix to be equal to zero, this is equivalent to making the equations linearly dependent . Linearly dependent equations can only be solved by assuming a solution for one (or more) of the unknowns (c's in this case); and the solution will always be in terms of the assumed c value. Note that when cr P P <, the transverse deflection is zero. Transverse deflection occurs only when cr P P ≥.Hence, we have for the cantilevered column the critical value of P:(10.16)For other end conditions, we can follow the same procedure to obtain:A10 - Introduction to Column Buckling 14For axial loads that are not perfectly centered, we obtain anentirely different result. Consider the case when P is offset by an amount ε:The problem may be worked as before, except that we treat the problem as having a perfectly centered load P plus a moment o M P ε= as shown above. We find that the third boundary condition in equations (10.10) is modified so that the right-hand side is equal to /o M EI . Following the same procedure, we find that the transverse deflection δ is given by:=sec1sec 1o M P δε⎛⎫⎛⎫=-=- ⎪ ⎪⎝⎭⎝⎭(10.17)Plotting P vs. δ gives the plot onthe right. For small values of P, the transverse deflection is very nearly zero. For example, δε< when49crit P P < where 224crit EI P Lπ= is the value obtained for a perfectlycentered load P on a cantilevered column. As P approaches the critical load, the deflection δbecomes very large. Because axial forces are rarely perfectly centered, one will always find some amountof transverse deflectionδ occurring before P reaches the critical load.。

如何从一个设备复制系统镜像到另一个

如何从一个设备复制系统镜像到另一个

如何从一个设备复制系统镜像到另一个ContentsIntroductionPrerequisitesRequirementsComponents UsedConventions复制从设备到设备在同一路由器里面命令汇总复制从一个路由器到另一个Related InformationIntroduction本文档说明了如何在同一个路由器内以及不同路由器之间将系统镜像从一个设备复制到另一个设备。

PrerequisitesRequirementsThere are no specific requirements for this document.Components UsedThis document is not restricted to specific software and hardware versions.为本文的目的使用的平台是思科2500系列路由器和Cisco 3600系列路由器。

ConventionsRefer to Cisco Technical Tips Conventions for more information on document conventions.复制从设备到设备在同一路由器里面复制的系统镜像表下面的提供options命令从一个设备到另一个(方法根据另外平台变化) :命令汇总表下面的列表您能从TFTP server复制镜像的多种位置。

这些选项根据另外平台变化。

请参见使用URL前缀欲知更多信息和为了得知更多这些选项中的每一个。

Router#copy tftp ?语法说明Bootflash :复制到Bootflash :文件系统disk0:复制到disk0 :文件系统disk1 :复制到disk1 :文件系统flash:复制闪动:文件系统flh :复制到flh :文件系统ftp :复制到ftp :文件系统lex :复制到lex :文件系统零位:复制使无效:文件系统nvram :复制到nvram :文件系统rcp :复制到rcp :文件系统running-config更新(合并与)当前系统配置slot0 :复制到slot0 :文件系统slot1:复制到slot1 :文件系统startup-config复制到启动配置系统:复制到系统:文件系统tftp :复制到tftp :文件系统镜像复制使用的三个最普通的命令是:copy tftp flashqcopy rcp flashq复制slot0 :slot1:q下面的示例说明程序为复制系统镜像跟随从一个设备到另一个(例如,从一张slot/磁盘到另一张slot/磁盘)在Cisco 3600系列路由器。

visual basic 2012 大学教程(第10章)

visual basic 2012 大学教程(第10章)

10. Object-Oriented Programming: Inheritance and PolymorphismSay not you know another entirely, till you have divided an inheritancewith him.—Johann Kasper LavaterThis method is to define as the number of a class the class of all classessimilar to the given class.—Bertr and RussellA philosopher of imposing stature doesn’t think in a vacuum. Even hismost abstract ideas are, to some extent, conditioned by what is or is notknown in the time when he lives.—Alfred North WhiteheadObjectivesIn this chapter you’ll learn:• What inheritance is and how it promotes software reuse.• To use keyword Inherits to create a derived class that inherits attributes andbehaviors from a base class.• To use access modifier Protected to give derived-class methods access to base-class members.• How constructors are used in inheritance hierarchies.• What polymorphism is and how it makes systems extensible and maintainable.• To distinguish between abstract and concrete classes.Outline10.1 Introduction10.2 Base Classes and Derived Classes10.3 Business Case Study: Commission Employees Class Hierarchy10.3.1 Creating Base Class CommissionEmployee10.3.2 Creating Derived Class BasePlusCommissionEmployee10.3.3 Testing Class BasePlusCommissionEmployee10.4 Constructors in Derived Classes10.5Protected Members10.6 Introduction to Polymorphism: A Polymorphic Video Game10.7 Abstract Classes and Methods10.8 Case Study: Payroll System Class Hierarchy Using Polymorphism10.8.1 Abstract Base Class Employee10.8.2 Concrete Derived Class SalariedEmployee10.8.3 Concrete Derived Class CommissionEmployee10.8.4 Indirect Concrete Derived Class BasePlusCommissionEmployee10.8.5 Demonstrating Polymorphic Processing10.9 Online Case Study: Interfaces10.10 Wrap-UpSummary | Terminology | Self-Review Exercises | Answers to Self-Review Exercises | Exercises10.1. IntroductionThis chapter continues our discussion of object-oriented programming by introducing inheritance, a form of software reuse in which a new class is created quickly and easily by absorbing an existing class’s members and customizing them with new or modified capabilities. With inheritance, you can save time during program development and build better software by reusing proven, high-quality classes. Enormous numbers of these classes are available in class libraries provided by Microsoft and independent software vendors.When creating a class, rather than declaring completely new members, you can designate that the new class inherits the members of an existing class. The existing class is called the base class, and the new class is the derived class.A derived class can add its own instance variables, Shared variables, properties and methods, and it can customize methods and properties it inherits. Therefore, a derived class is more specific than its base class and represents a more specialized group of objects.We explain and demonstrate polymorphism, which enables you to conveniently program ―in the general‖ rather than ―in the specific.‖ As we send method calls in thisgeneral way, the specific objects ―do the right thing.‖ You’ll see that polymorphism simplifies programming with classes and makes it easy to extend systems with new capabilities.10.2. Base Classes and Derived ClassesInheritance enables an is-a relationship. In an is-a relationship, an object of a derived class also can be treated as an object of its base class. For example, a car is a vehicle. Figure 10.1 lists several simple examples of base classes and derived classes—base classes tend to be more general and derived classes tend to be more specific. Base-class objects cannot be treated as objects of their derived classes—although all cars are vehicles, not all vehicles are cars (the other vehicles could be trucks, planes or bicycles, for example).Fig. 10.1. Inheritance examples.Because every derived-class object is an object of its base class, and one base class can have many derived classes, the set of objects represented by a base class is typically larger than the set of objects represented by any of its derived classes. For example, the base class Vehicle represents all vehicles, including cars, trucks, boats, bicycles and so on. By contrast, derived class Car represents a smaller, more specific subset of vehicles. CommunityMember Inheritance HierarchyFigure 10.2 shows a sample UML class diagram of an inheritance hierarchy. A college community has thousands of community members, including employees, students and alumni. Employees are either faculty members or staff members. Faculty members are either administrators (such as deans and department chairpersons) or teachers. The hierarchy could contain many other classes. For example, students can be graduate or undergraduate students. Undergraduate students can be freshmen, sophomores, juniors or seniors.Fig. 10.2. Inheritance hierarchy for university CommunityMembers.Each arrow in the inheritance hierarchy represents an is-a relationship. As we follow the arrows upward in this class hierarchy, we can state, for instance, that ―an Employee is a CommunityMember‖ and ―a Teacher is a Faculty member.‖A direct base class is the class from which a derived class explicitly inherits. An indirect base class is inherited from two or more levels up in the class hierarchy. So, class CommunityMember is the direct base class of Employee, Student and Alumnus, and is an indirect base class of all the other classes in the diagram. Starting from the bottom of the diagram, you can follow the arrows and apply the is-a relationship up to the topmost base class. For example, an Administrator is a Faculty member, is an Employee and is a CommunityMember. Shape Inheritance HierarchyNow consider the Shape hierarchy in Fig. 10.3. It begins with base class Shape, which is inherited by derived classes TwoDimensionalShape and ThreeDimensionalShape—Shape s are either TwoDimensionalShape s or ThreeDimensionalShape s. The third level of the hierarchy contains more specific types of TwoDimensionalShape s and ThreeDimensionalShape s. As in Fig. 10.2, we can follow the arrows from the derived classes at the bottom of the diagram to the topmost base class in this class hierarchy to identify several is-a relationships. For example, a Triangle is a TwoDimensionalShape and is a Shape, while a Sphere is a ThreeDimensionalShape and is a Shape. Shape is a direct base class of classes TwoDimensionalShape and ThreeDimensionalShape, and is an indirect base class of all the classes on the third level.Fig. 10.3. Inheritance hierarchy for Shapes.10.3. Business Case Study: Commission Employees Class HierarchyIn this section, we use a business-oriented inheritance hierarchy containing types of employees in a company’s payroll app to discuss the relationshi p between a base class and its derived class. All employees of the company have a lot in common, but commission employees (who will be represented as objects of a base class) are paid a percentage of their sales, while base-salaried commission employees (who will be represented as objects of a derived class) receive a percentage of their sales plus a base salary. First, we present base class CommissionEmployee. Next, we create a derived class BasePlusCommissionEmployee that inherits from class CommissionEmployee. Then we present an app that creates a BasePlusCommissionEmployee object and demonstrates that it has all the capabilities of the base class and the derived class, but calculates its earnings differently.10.3.1. Creating Base Class CommissionEmployeeConsider class CommissionEmployee (Fig. 10.4). The Public services of class CommissionEmployee include:• a constructo r (lines 11–20)• properties FirstName (line 4), LastName (line 5), SocialSecurityNumber (line 6), GrossSales (lines 23–36) and CommissionRate (lines 39–52)• methods CalculateEarnings (lines 55–57) and ToString (lines 60–66).Click here to view code image1' Fig. 10.4: CommmissionEmployee.vb2' CommissionEmployee base class.3Public Class CommissionEmployee4Public Property FirstName() As String' auto-implemented5Public Property LastName() As String' auto-implemented6Public Property SocialSecurityNumber() As String' auto-implemented7Private grossSalesValue As Decimal' gross weekly sales8Private commissionRateValue As Double' commission percentage 910' five-argument constructor11Public Sub New(first As String, last As String,12 ssn As String, sales As Decimal, rate As Double)1314' implicit call to class Object's constructor occurs here15 FirstName = first16 LastName = last17 SocialSecurityNumber = ssn18 GrossSales = sales ' validate and store gross sales19 CommissionRate = rate ' validate and store commission rate20End Sub' New2122' property GrossSales23Public Property GrossSales() As Decimal24Get25Return grossSalesValue26End Get2728Set(sales As Decimal)29If sales >= 0D Then' validate gross sales30 grossSalesValue = sales ' valid31Else32Throw New ArgumentOutOfRangeException( 33"Gross sales must be greater than or equal to 0")34End If35End Set36End Property' GrossSales3738' property CommissionRate39Public Property CommissionRate() As Double40Get41Return commissionRateValue42End Get4344Set(rate As Double)45If rate > 0.0 AndAlso rate < 1.0Then' validate rate46 commissionRateValue = rate ' valid47Else48Throw New ArgumentOutOfRangeException( 49"Interest rate must be greater than 0 and less than 1") 50End If51End Set52End Property' CommissionRate5354' calculate earnings55Public Overridable Function CalculateEarnings() As Decimal56Return Convert.ToDecimal(CommissionRate) * GrossSales57End Function' CalculateEarnings5859' return String representation of CommissionEmployee object60Public Overrides Function ToString() As String61Return"commission employee: " & FirstName & " " & LastName & 62vbCrLf & "social security number: " & SocialSecurityNumber & 63vbCrLf & "gross sales: " & String.Format("{0:C}", GrossSales) & 64vbCrLf & "commission rate: " &65 String.Format("{0:F}", CommissionRate)66End Function' ToString67End Class' CommissionEmployeeFig. 10.4. CommissionEmployee base class.The class also declares Private instance variables grossSalesValue and commissionRate-Value (lines 7–8) to represent the employe e’s gross sales and commission rate. Recall that the compiler automatically generates a Private instance variable for each auto-implemented property, so a CommissionEmployee actually has five Private instance variables.The Set accessors of properties GrossSales and CommissionRate validate their arguments before assigning the values to instance variables grossSalesValue and commissionRateValue, respectively. Properties FirstName, LastName and SocialSecurityNumber are auto-implemented in this example, becaus e we’re not providing any validation code in their Set accessors. We could validate the first and last names—perhaps by ensuring that they’re of a reasonable length. The social security number could be validated to ensure that it contains nine digits, with or without dashes (for example, 123-45-6789 or 123456789).All Classes Inherit Directly or Indirectly from Object (from Namespace System)You use inheritance to create new classes from existing ones. Every class except Object inherits from an existing class. When you do not explicitly specify the base class for a new class, the compiler implicitly assumes that the class Inherits from Object. The class hierarchy begins with class Object (in namespace System), which every class directly or indirectly extends (or ―inherits from‖). So, the beginning of class CommissionEmployee could be written asPublic Class CommissionEmployeeInherits ObjectYou typically do not include ―Inherits Object‖ in your code, since it’s implied. Class CommissionEmployee inherits the methods of class Object—class Object does not have any fields. One of the methods inherited from class Object is ToString, so every class has a ToString method that returns a String representation of the object on which it’s called. We discuss the default behavior of method ToString momentarily. CommissionEmployee ConstructorConstructors are not inherited, so class CommissionEmployee does not inherit class Object’s constructor. However, class CommissionEmployee’s constructor (lines 11–20) calls Object’s constructor implicitly. In fact, the first task of any derived-class constructor is to call its direct base class’s con structor, either explicitly or implicitly (if no constructor call is specified), to ensure that the instance variables declared in the base class are initialized properly. The syntax for calling a base-class constructor explicitly is discussed in Section 10.3.2. If the code does not include an explicit call to the base-class constructor, Visual Basic implicitly calls the base class’s default or parameterless constructor. The comment in line 14 of Fig. 10.4 indicates where the implicit call to the base class Object’s default constructor occurs (you do not need to write the code for this call). Object’s default constructor does nothing. Even if a class does not have constructors, the default constructor that the compiler implicitly creates for the class will call the base class’s default or parameterless constructor. After the implicit call to Object’s constructor occurs, lines 15–19 assign values to the class’s properties.Method CalculateEarnings and Declaring Methods OverridableMethod CalculateEarnings (lines 55–57) calculates a CommissionEmployee’s earnings. Line 56 multiplies the CommissionRate by the GrossSales and returns the result. A base-class method must be declared Overridable if a derived class should be allowed to override the method with a version more appropriate for that class. When we create class BasePlusCommissionEmployee, we’ll want to override (redefine) CommissionEmployee’s CalculateEarnings method to customize the earnings calculation for a BasePlusCommissionEmployee. For this reason, we declared CalculateEarnings as Overridable in line 55. In BasePlusCommissionEmployee, we’ll declare method CalculateEarnings with the keyword Overrides.Method ToString and Overriding Base Class MethodsMethod ToString (lines 60–66) returns a String containing information about the CommissionEmployee. The keyword Overrides (line 60) indicates that this method overrides (redefines) the version of ToString that was inherited from CommissionEmployee’s base class (that is, Object). In class Object, method ToString is declared as:Public Overridable Function ToString() As Stringso that ToString can be overridden in any derived class.If you do not override ToString in class CommissionEmployee, the default implementation inherited from class Object would return only"missionEmployee"—for this example, we named the project InheritanceTest.10.3.2. Creating Derived Class BasePlusCommissionEmployeeMost of a BasePlusCommissionEmployee’s capabilities are similar, if not identical, to the those of class CommissionEmployee (Fig. 10.4). Both classes require instance variables for the first name, last name, social security number, gross sales and commission rate, and properties and methods to manipulate that data. To create class BasePlusCommissionEmployee without using inheritance, we probably would have copied the code from class CommissionEmployee and pasted it into class BasePlusCommissionEmployee, then modified the new class to include a base salary instance variable, and the methods and properties that manipulate the base salary, including a new CalculateEarnings method. This copy-and-paste approach is often error prone and time consuming. Worse yet, it can spread many physical copies of the same code (including errors) throughout a system, creating a code-maintenance nightmare. Is there a way to ―absorb‖ the instance variables and methods of one class in a way that makes them part of another class without duplicating code? Indeed there is—using the elegant object-oriented programming technique of inheritance.Software Engineering Observation 10.1With inheritance, the common instance variables and methods of all the classesin the hierarchy are declared only in a base class. When changes are required forthese common features, you need to make the changes only in the base class—derived classes then inherit the changes. Without inheritance, the changes wouldneed to be made to all the source-code files that contain copies of the code inquestion.Declaring Class BasePlusCommissionEmployeeWe now discuss the second part of our introduction to inheritance by declaring the derived class BasePlusCommissionEmployee (Fig. 10.5), which inherits most of its capabilities from class CommissionEmployee (line 4). A BasePlusCommissionEmployee is a CommissionEmployee (because inheritance passes on the capabilities of class CommissionEmployee), but class BasePlusCommissionEmployee also has• instance variable baseSalaryValue (line 6)• property BaseSalary (lines 19–32).Also, BasePlusCommissionEmployee provides• a constructor (lines 9–16)• a customized version of method CalculateEarnings (lines 35–37)• a customized version of method ToString (lines 40–43).Click here to view code image1' Fig. 10.5: BasePlusCommissionEmployee.vb2' BasePlusCommissionEmployee inherits from class CommissionEmployee.3Public Class BasePlusCommissionEmployee4Inherits CommissionEmployee56Private baseSalaryValue As Decimal' base salary per week78' six-argument constructor9Public Sub New(first As String, last As String,10 ssn As String, sales As Decimal,11 rate As Double, salary As Decimal )1213' use MyBase reference to call CommissionEmployee constructor14MyBase.New(first, last, ssn, sales, rate)15 BaseSalary = salary ' validate and store base salary16End Sub' New1718' property BaseSalary19Public Property BaseSalary() As Decimal20Get21Return baseSalaryValue22End Get2324Set(salary As Decimal)25If salary >= 0D Then' validate base salary26 baseSalaryValue = salary ' valid27Else28Throw New ArgumentOutOfRangeException(29"Base salary must be greater than or equal to 0")30End If31End Set32End Property' BaseSalary3334' calculate earnings35Public Overrides Function CalculateEarnings() As Decimal36Return BaseSalary + MyBase.CalculateEarnings()37End Function' CalculateEarnings3839' return String representation of BasePlusCommissionEmployee object40Public Overrides Function ToString() As String41Return"base-plus-" & MyBase.ToString() & vbCrLf &42"base salary: " & String.Format("{0:C}", BaseSalary)43End Function' ToString44End Class' BasePlusCommissionEmployeeFig. 10.5. BasePlusCommissionEmployee class inherits from classCommissionEmployee.Inheriting from Class CommissionEmployeeKeyword Inherits in line 4 of the class declaration indicates that class BasePlusCommissionEmployee inherits all of the Public members (and, as we’ll soon see, Protected members if there were any) of class CommissionEmployee. We do not redeclare the base class’s Private instance variables—these are nevertheless present (but hidden) in deriv ed class objects. Even though they’re present, they’re declared Private in the base class, so as we’ll see in a moment, we’ll have to make a special provision to access this base-class information from the derived class. The CommissionEmployee constructor is not inherited. Thus, the Public services of BasePlusCommissionEmployee include its• constructor (lines 9–16)• the Public methods and properties inherited from class CommissionEmployee• property BaseSalary (lines 19–32), which cannot be auto-implemented because it performs validation in its Set accessor• method CalculateEarnings (lines 35–37)• method ToString (lines 40–43).BasePlusCommissionEmployee ConstructorEach derived-class constructor must implicitly or explicitly call its base-class constructor to ensure that the instance variables inherited from the base class are properly initialized. BasePlusCommissionEmployee’s six-argument constructor (lines 9–16) explicitly calls class CommissionEmployee’s five-argument constructor (line 14) to initialize the base class portion of a BasePlusCommissionEmployee object (that is, the five instance variables from class CommissionEmployee). Line 14 uses the base-class constructor call syntax—keyword MyBase, followed by the dot (.) separator, followed by New and a set of parentheses containing the arguments to the base-class constructor—first, last, ssn, sales and rate. Then, line 15 initializes the BasePlusCommissionEmployee’s base salary.If the BasePlusCommissionEmployee constructor did not include line 14, Visual Basic would attempt to invoke class CommissionEmployee’s parameterless or default constructor, which does not exist, so a compilation error would occur. The explicit base-class constructor call (line 14) must be the first statement in the derived-class constructor’s body.Overriding Method CalculateEarningsClass BasePlusCommissionEmployee’s CalculateEarnings method (lines 35–37) overrides class CommissionEmployee’s CalculateEarnings method (Fig. 10.4, lines 55–57) to calculate the earnings of a base-salaried commission employee. The new version obtains the portion of the employee’s earnings based on co mmission alone by calling CommissionEmployee’s CalculateEarnings method with the expressionMyBase.CalculateEarnings() (line 36). BasePlusCommissionEmployee’s CalculateEarnings method then adds the BaseSalary to this value to calculate the total earnings of the derived-class employee. Note the syntax used to invoke an overridden base-class method from a derived class—place the keyword MyBase and a dot (.) separator before the base-class method name. By having BasePlusCommissionEmployee’s CalculateEarnings method invoke CommissionEmployee’s CalculateEarnings method to calculate part of a BasePlusCommissionEmployee object’s earnings, we avoid duplicating the code and reduce code-maintenance problems.Overriding Method ToStringBasePlusCommissionEmployee’s ToString method (lines 40–43) overrides class CommissionEmployee’s ToString method (Fig. 10.4, lines 60–66) to return a String representation that’s appropriate for a BasePlusCommissionEmployee. The derived class creates part of a BasePlusCommissionEmployee object’s String representation by concatenating "base-plus-" with the String returned by calling CommissionEmployee’s ToString method via the expression MyBase.ToString() (Fig. 10.5, line 41). BasePlusCommissionEmployee’s ToString method then concatenates the remainder of a BasePlusCommissionEmployee object’s String representation (that is, the value of class BasePlusCommissionEmployee’s base salary) before returning the String.10.3.3. Testing Class BasePlusCommissionEmployeeFigure 10.6 tests class BasePlusCommissionEmployee. Lines 9–10 create a BasePlusCommissionEmployee object and pass "Bob", "Lewis", "333-33-3333", 5000, 0.04 and 300 to the constructor as the first name, last name, social security number, gross sales, commission rate and base salary, respectively. Lines 13–22 use BasePlusCommissionEmployee’s properties to output the object’s data. Notice th at we’re able to access all of the Public properties of classes CommissionEmployee and BasePlusCommissionEmployee here. Lines 25–26 calculate and display the BasePlusCommissionEmployee’s earnings by calling its CalculateEarnings method. Because this method is called on a BasePlusCommissionEmployee object, the derived-class version of the method executes. Next, lines 29–31 modify the GrossSales, CommissionRate and BaseSalary properties. Lines 34–36 output the updated data—this time by calling the BasePlusCommissionEmployee’s ToString method. Again, because this method is called on a BasePlusCommissionEmployee object, the derived classversion of the method executes. Finally, lines 39–40 calculate and display the BasePlusCommissionEmployee’s updated earnings.Click here to view code image1' Fig. 10.6: InheritanceTest.vb2' Testing derived class BasePlusCommissionEmployee.3Public Class InheritanceTest4' demonstrate class BasePlusCommissionEmployee5Private Sub InheritanceTest_Load(sender As Object,6 e As EventArgs) Handles MyBase.Load78' instantiate BasePlusCommissionEmployee object9Dim employee As New BasePlusCommissionEmployee(10"Bob", "Lewis", "333-33-3333", 5000D, 0.04, 300D)1112' get base-salaried commission employee data13 outputTextBox.AppendText(14"Employee information obtained by properties:" & vbCrLf & 15"First name is " & employee.FirstName & vbCrLf &16"Last name is " & stName & vbCrLf &17"Social Security Number is " & employee.SocialSecurityNumber & 18vbCrLf & "Gross sales is " &19 String.Format("{0:C}", employee.GrossSales) & vbCrLf &20"Commission rate is " &21 String.Format("{0:F}", missionRate) & vbCrLf &22"Base salary is " & String.Format("{0:C}", employee.BaseSalary)) 2324' display the employee's earnings25 outputTextBox.AppendText(vbCrLf & vbCrLf & "Earnings: " &26 String.Format("{0:C}", employee.CalculateEarnings()))2728' modify properties29 employee.GrossSales = 10000D' set gross sales30 missionRate = 0.05' set commission rate31 employee.BaseSalary = 1000D' set base salary3233' get new employee information34 outputTextBox.AppendText(vbCrLf & vbCrLf &35"Updated employee information returned by ToString: " &36vbCrLf & employee.ToString())3738' display the employee's earnings39 outputTextBox.AppendText(vbCrLf & vbCrLf & "Earnings: " &40 String.Format("{0:C}", employee.CalculateEarnings()))41End Sub' InheritanceTest_Load42End Class' InheritanceTestFig. 10.6. Testing derived class BasePlusCommissionEmployee.10.4. Constructors in Derived ClassesCreating a derived-class object begins a chain of constructor calls in which the derived-class constructor, before performing its own tasks, invokes its direct base class’s constructor either explicitly (via the MyBase reference) or implicitly (calling the base class’s default or parameterless constructor). Similarly, if the base class is derived from another class (as is every class except Object), the base-class constructor invokes the constructor of the next class up the hierarchy, and so on. The last constructor called in the chain is always the constructor for class Object. The original derived-class constructor’s body finishes executing last.Each base class’s construct or initializes the base-class instance variables that are part of the derived-class object. For example, When a program creates a BasePlusCommissionEmployee object (Fig. 10.6, lines 9–10), the BasePlusCommissionEmployee constructor is called. That constructor, before executing its full body code, immediately calls CommissionEmployee’s constructor (Fig. 10.5, line 14), which in turn calls Object’s constructor. Class Object’s constructor has an empty body, so it immediately returns control to the CommissionEmployee’s constructor, which then initializes the Private instance variables of CommissionEmployee (Fig. 10.4, lines 15–19) that are part of the BasePlusCommissionEmployee object. When the。

Chapter10_PPT

Chapter10_PPT

to calculate Diameter, Circumference, Area and ToString
' calculate CCircle area Public Overridable Function Area() As Double Return Math.PI * mRadius ^ 2 End Function ' Area ' return String representation of CCircle Public Overrides Function ToString() As String ' use MyBase reference to return CCircle String representation Return "Center= " & MyBase.ToString() & _ "; Radius = " & mRadius End Function ' ToString
Outline
Circle.vb
7
Ensures radiusValue is greater or equal to zero
' calculate CCircle diameter Public Function Diameter() As Double Return mRadius * 2 Methods End Function ' Diameter ' calculate CCircle circumference Public Function Circumference() As Double Return Math.PI * Diameter() End Function ' Circumference

LWIP中文手册

LWIP中文手册
Lwip 协议栈的设计与实现
(中文版)
Swedish Institute of Computer Science February 20, 2001
作者:Adam Dunkels adam@sics.se 翻译:果农(QQ: 10205001)
核桃(QQ: 329147) 佳旭(QQ:3232253) 整理:佳旭(QQ:3232253) 本文为QQ群ARM TCPIP LCD(群号:10988210)版权所有 未经作者许可不得用于商业用途
10.3 Sequence number calculations…………………………………………………………………….12 10.4 Queuing and transmitting data…………………………………………………………………….12 10.4.1 Silly window avoidance…………………………………………………………………………13 10.5 Receiving segments………………………………………………………………………………..13 10.5.1 Demultiplexing…………………………………………………………………………………..13 10.5.2 Receiving data…………………………………………………………………………………...14 10.6 Accepting new connections ……………………………………………………………………….14 10.7 Fast retransmit……………………………………………………………………………………..14 10.8 Timers……………………………………………………………………………………………..14 10.9 Round-trip time estimation………………………………………………………………………..15 10.10Congestion control………………………………………………………………………………..15 11 Interfacing the stack ………………………………………………………………………………15 12 Application Program Interface……………………………………………………………. ……..16 12.1 Basic concepts……………………………………………………………………………………..16 12.2 Implementation of the API……………………………………………………………………….. 17 13 Statistical code analysis ……………………………………………………………………………17 13.1 Lines of code………………………………………………………………………………………18 13.2 Object code size…………………………………………………………………………………...19 14 Performance analysis……………………………………………………………………… ……...20 15 API reference………………………………………………………………………………. ……...21 15.1 Data types………………………………………………………………………………………….21 15.1.1 Netbufs…………………………………………………………………………………………..21 15.2 Bu®er functions …………………………………………………………………………………..21 15.2.1 netbuf new()……………………………………………………………………………………..21 15.2.2 netbuf delete()…………………………………………………………………………………...21 15.2.3 netbuf alloc()…………………………………………………………………………………….22 15.2.4 netbuf free()……………………………………………………………………………………..22 15.2.5 netbuf ref()………………………………………………………………………………………22 15.2.6 netbuf len()……………………………………………………………………………………... 23 15.2.7 netbuf data()……………………………………………………………………………………. 23 15.2.8 netbuf next()……………………………………………………………………………………. 23 15.2.9 netbuf ¯rst()……………………………………………………………………………………..24 15.2.10 netbuf copy()…………………………………………………………………………………...24 15.2.11 netbuf chain()…………………………………………………………………………………..24 15.2.12 netbuf fromaddr()………………………………………………………………………………24 15.2.13 netbuf fromport()……………………………………………………………………………… 25 16 Network connection functions …………………………………………………………………….25 16.0.14 netconn new()…………………………………………………………………………………..25 16.0.15 netconn delete()………………………………………………………………………………...25 16.0.16 netconn type()…………………………………………………………………………………..25 16.0.17 netconn peer()…………………………………………………………………………………. 25 16.0.18 netconn addr()………………………………………………………………………………… 26 16.0.19 netconn bind()………………………………………………………………………………… 26 16.0.20 netconn connect(……………………………………………………………………………….26 16.0.21 netconn listen()…………………………………………………………………………………26 16.0.22 netconn accept()………………………………………………………………………………..26 16.0.23 netconn recv()………………………………………………………………………………….27 16.0.24 netconn write()…………………………………………………………………………………28 16.0.25 netconn send()………………………………………………………………………………….29 16.0.26 netconn close()…………………………………………………………………………………30 17 BSD socket library ………………………………………………………………………………...30 17.1 The representation of a socket…………………………………………………………………….30 17.2 Allocating a socket ………………………………………………………………………………..30 17.2.1 The socket() call…………………………………………………………………………………30 17.3 Connection setup…………………………………………………………………………………..31 17.3.1 The bind() call…………………………………………………………………………………...31

基础分子生物学10操纵子

基础分子生物学10操纵子
• 对于同一条代谢途径中的某些蛋白质, 通常编 码它们的基因在DNA上也紧密排列在一起, 并 作为一个转录单位转录出多顺反子mRNA.
教学ppt
6
lac操纵子长约6kb, 上游的lacI具有自己的
启动子和终止子, lacI的末端紧接着启动子P,
操纵基因O位于转录单位最前端26bp, lacZ
基因从第39个碱基开始, 随后是lacY基因, 和
基因的转录.
教学ppt
10
加入诱导物使lac mRNA迅速产生, 酶的合成则有一 个短暂的延迟, 除 去诱导物则立刻 使合成停止.
教学ppt
11
10.6 Repressor is controlled by a small molecule inducer. 阻抑物由小分子诱导物所控制.
• 诱导物可以使阻抑物失活. • 阻抑物具有两个结合位点, 分别与操纵基因
教学ppt8在lac纵子的转 录起始位点周围, 阻抑物和RNA聚 合酶的结合位点 是重叠的.
教学ppt
9
10.5 The lac operon can be induced. 乳糖操纵子是可诱导的.
• 可以对操纵子进行诱导的小分子结构通常与操纵 子所表达的酶的底物结构相同或相似.
• -半乳糖苷是lacZYA基因编码的底物. • -半乳糖苷不存在时, 乳糖操纵子的表达水平极低. • 加入-半乳糖苷可以诱导乳糖操纵子中三个结构
• DNA结合结构域具有两个短螺旋, 用来与 DNA的大沟结合.
• 负责多聚化的区域和诱导物结合位点都位 于核心区.
教学ppt
17
Lac阻抑物通单体 的结构, 含有数个 独立的结构域.
教学ppt
18
阻抑物四聚体由 两个二聚体构成.

Unit10

Unit10

Unit 10 The Virtues of Ambition
critical of conservatism and the Republican Party, and a registered independent supporting impeachment of President George W. Bush.
Unit 10 The Virtues of Ambition
3. participatory democracy Participatory democracy is a process emphasizing the broad participation (decision making) of constituents in the direction and operation of political systems. While etymological roots imply that any democracy would rely on the participation of its citizens, traditional representative democracies tend to limit citizen participation to voting, leaving actual governance to politicians. Participatory democracy strives to create opportunities for all members of a political group to make meaningful contributions to decision-making, and seeks to broaden the range of people who have access to such opportunities.
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Adolescent
Think of a question/phenomena that belongs to the area of psychological study.
II. How Do We Study?
Scientific Study
Falsifiability 可证伪性 A falsifiable statement is one that could possibly be proven wrong.
Psychology is the science of
behavior and mental processes.
I. What Do We Study?
II. How Do We Study?
How should we
STUDY
psychology?
Assignment #1
• Make your term/weekly study goal/plan for this course. • Form your group
Learn Efficiently……
• Allocate your time efficiently
• Practice your learning “muscle” (over-learning)
• Preview (structure) • Read details • Think critically: how they relate to your prior experiences, how they could be applied, convincing? • Review and make connections in life
Syllabus & Course Schedule
Who am I? Syllabus Introduction
Who are you?
Course Schedule
What is Psychology?
Syllabus & Course Schedule
Who am I? Syllabus Introduction
• Ask questions!!!
Check out
PSYCHOLOGY page xxxi – xxxviii
Who Am I?
Education Research
Values Why
Values
Diversity Curiosity Happiness
Who Am I?
Education Research
Values Why
Why do I Study Psychology?
Who Are You?
I. What Do We Study?
Emotional & Motivational Processes 情绪、动机过程
Cognitive Processes 认知过程
Personality & Ability 人格与能力发展
I. What Do We Study?
Infancy
Childhood
Course Schedule
What is Psychology?
Who Am I?
Education Research
Values Why
Education
Bachelor in Education BeijingNormal University (2005-2009)
Education
Who are you?
Course Schedule
What is Psychology?
What is
PSYCHOLOG?
It’s NOT……
It’s NOT……
It’s NOT……
What people think of psychologists do……
My Parents
My Friends
A black swan disproves the theory that “all swans are white”.
PRACTICE Which of the following statements are falsifiable? Which are not?
Humans spirits can be alive even after they die. Heart stops functioning after people die. The pain in your leg is due to the inflammation at your joint. The pain in your leg is due to the Yin and Yang being out of order in your body.
Introduction: What is Psychology?
Instructor: Dr. Ni Yan (晏妮) Faculty of Psychology Southwest University
Today’s Agenda
Who am I? Syllabus Introduction
Who are you?
The General Public
Other Scientist
Myself
In reality……
Psychology is the science of
behavior and mental processes.
I. What Do We Study?
II. How Do We Study?
Ph.D. in Human Development & Family Sciences University of Texas at Austin (2009-2014)
Who Am I?
Education Research
Values Why
Research
Maternal Depression Parent-child interactions Child Processes Temperament Withdrawal Autonomy Effortful control
相关文档
最新文档