Question
Solve the following Questions in detail. (a) Consider a simple client-server system implemented using Java Remote Method Invocation (RMI). Describe: (i) how the interface between
Solve the following Questions in detail.
(a) Consider a simple client-server system implemented using Java Remote Method Invocation (RMI). Describe: (i) how the interface between the client and the server is dened; [4 marks] (ii) how a particular instance of the server is named. [4 marks] (b) One operation provided by the server is to merge the contents of two hashtables, returning the result in a new hashtable. On a centralized system the operation's signature could be dened as follows: Hashtable mergeTables(Hashtable a, Hashtable b) Describe in detail the semantics with which parameters are passed and results are returned when this operation is implemented over RMI. [4 marks] (c) The designer of a new RMI system proposes lazily copying the contents of objects that are passed between the client and the server. For instance, a large data item passed to mergeTables would have to be sent only if the server actually tries to access it. It is hoped that this scheme will make distributed systems faster because it will reduce the volume of data sent over the network. (i) Describe a situation in which the new system is likely to be faster than traditional RMI and a separate situation in which it is likely to be slower. [2 marks each] (ii) How would this new scheme change the semantics with which parameters are passed and results are returned? [4 marks](a) We wish to produce two algorithms: one which draws the outline of a circle and one which draws a lled circle. (i) Describe an ecient algorithm which will draw a one-pixel wide outline of a circle of integer radius, R, centred on the origin. [10 marks] (ii) Describe the modications required to your algorithm to make it draw a lled circle. [3 marks] (b) Given a function drawline(x1,y1,x2,y2), describe an algorithm for drawing a Bezier cubic curve to a specied level of accuracy using only straight lines. [7 marks]
You have been provided with the description of a programming language, J, intended for scripting applications. Its syntax is similar to a cut-down version of Java in that it consists of function denitions which have bodies containing if-then-else, while-do, assignments and (typed) declarations of variables. Only one statement or keyword may occur on a line so that it is sucient to describe the start of a loop iteration with its line number. You need to explain to your boss the alternatives for implementing this so that a decision may be made as to the best implementation strategy. The choice is between: (a) compiling J to machine code; (b) compiling J to "interpreted byte code", and then interpreting this; (c) parsing J to a syntax tree representation and then interpreting this using a function which walks the tree; (d) keeping J in a text le and then interpreting it by reading each line (and acting on it) as and when the line is required. For each of (a)-(d), (i) summarise the main phases of work that are done before execution in each case, giving a brief explanation of the main actions of the main interpreter loop (if any) during execution, and (ii) for each of the following possible erroneous forms, explain whether the error would be found before or during execution: malformed syntax, undeclared variable, type error, division by zero. [5 marks each] You are not expected to argue for or against any of the alternatives. Movie(title,year,length,prodC#) StarsIn(movieTitle,movieYear,starName) Producer(name,address,cert) MovieStar(name,gender,birthdate) (a) Write the following queries in SQL: (i) Who were the male stars in the lm The Red Squirrel? [1 mark] (ii) Which movies are longer than Titanic? [2 marks] (b) SQL has a boolean-valued operator IN such that the expression s IN R is true when s is contained in the relation R (assume for simplicity that R is a single attribute relation and hence s is a simple atomic value). (a) Specify an appropriate knot vector for each of the following NURBS curves. (i) A uniform cubic NURBS curve dened by six control points. (ii) Similar to (i) but passing through both endpoints. (iii) Similar to (i) but passing through the third control point, possibly with lower continuity at that point. (iv) The cubic Bezier curve dened by four control points. [8 marks] (b) Give the continuity class for each of: (i) curve (a)(i) between the knots; (ii) curve (a)(ii) at the knots; (iii) curve (a)(iii) at the third control point. [The continuity class is the highest derivative which is guaranteed to be continuous at the point(s) in question.] [3 marks] (c) The Loop and Buttery subdivision schemes can both operate on triangular meshes, in which all of the polygons have three sides. Both schemes subdivide the mesh by introducing new vertices at the midpoints of edges, splitting every original triangle into four smaller triangles, as shown below. Each scheme has rules for calculating the locations of the new "edge" and "vertex" vertices based on the locations of the old vertices. These rules are shown below. All weights should be multiplied by 1 16.
(a) Dene the terms at and hierarchical as applied to address spaces. [2 marks] (b) Give four examples of address spaces and state whether they are at or hierarchical, and why. [4 marks] (c) Describe class-based addresses as used in the Internet. You need not worry about precise eld sizes or class names. [4 marks] (d) Describe classless addresses as used in the Internet. [3 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started