Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

run the code in the prog1_mandelbrot_threads/index of the Assignment 1 code base. This program creates the picture document mandelbrot-serial.ppm1, which ies a representation of a

run the code in the prog1_mandelbrot_threads/index of the Assignment 1 code base. This program creates the picture document mandelbrot-serial.ppm1, which ies a representation of a popular arrangement of complicated numbers called the Mandelbrot set. As you can find in the pictures beneath, the outcome is a natural and lovely fractal. Every pixel in the picture compares to a worth in the intricate plane, and the splendor of every pixel is corresponding to the computational expense of deciding if the worth is contained in the Mandelbrot set. Screens are in many cases given in simultaneous programming dialects to help the association of cycles through shared information. Examine the screen instrument and its execution. [10 marks] How might the screen instrument at some point be adjusted to consider many shared information objects of a similar sort? [2 marks] What benefits, if any, could be gotten from utilizing a functioning item rather than a screen; that is, a screen like design with at least one inside bound processes? KGKGKGKGKGKG

The accompanying tables are essential for a library's information base framework. Book(book id, title, number possessed, number acquired) Person(person id, name, address) Borrowed(person id, book id, number) The essential keys of each table are in striking. In the table Book the section number claimed is the quantity of duplicates of the book possessed by the library, while the segment number acquired is the quantity of duplicates as of now out borrowed. In table Borrowed the section individual id is an unfamiliar key into the Person table, the segment book id is an unfamiliar key into the Book table. The segment number is the quantity of duplicates of the book acquired by the related individual. (This library is utilized by elementary teachers who regularly look at many duplicates of a book for the utilization in their classes.) If the data set is inside steady, then the segment number acquired is excess data that can be processed from the genuine number acquired, and this can be gotten from the Borrowed table. (a) Write a SQL question that actually looks at the inside consistency of this information base. It ought to return records of the structure (book id, number acquired, genuine number acquired) just for those books where number acquired and real number acquired are not equivalent. That is, assuming the information base is steady the inquiry will return no records. [5 marks] (b) Your responsibility is to overhaul this construction so there is no requirement for such consistency checks. The initial step is to plan an Entity-Relationship model. You will do this by presenting another substance called Copy Of. Each duplicate of a book claimed by the library will be related with a remarkable individual from the Copy Of element. Plan an Entity-Relationship chart in light of this thought and contend that cardinality limitations will guarantee that the information base is inside predictable. [5 marks] (c) Discuss no less than two choices for executing your ER model in a SQL data set. [5 marks] (d) Using one of your social executions from the past part, compose a SQL inquiry that recreates the items in the Book table from the first plan. That is, put down a SQL question that profits accounts of the structure (book id, title, number possessed, number acquired

Far off Procedure Call (RPC) permits techniques (capacities, strategies) to be sent over the organization, and is a basic structure square of appropriated frameworks, for example, the Network File Synchronous [1 mark] (ii) Asynchronous [1 mark] (iii) Idempotent [1 mark] (b) Distributed-filesystem clients use various tradeoffs among execution and consistency for procedure on the registry namespace (e.g., record or catalog creation) versus those on document information itself. The accompanying system makes and opens a record foo, thinks of an information to it, and closes it, through NFSv3: fd = open("foo", O_CREAT | O_RDWR, 0755);//POINT A write(fd, information, sizeof(data));//POINT B close(fd);//POINT C For every one of focuses A, B, and C in the program, examine if one more NFSv3 client is destined to have the option to see the aftereffects of every one of open and (on the off chance that it has been called) compose. [5 marks] (c) The designers of a new dispersed filesystem utilize a determined log to guarantee win big or bust retry semantics for filesystem activities. Notwithstanding, this comes at a significant exhibition cost. Portray two conditions under which filesystem RPCs can be avoided from the log while keeping up with rightness, and give an illustration of each. [4 marks] (d) The circulated filesystem's relentless RPC log is kept up with in a compose ahead log put away in neighborhood plate blocks. Make sense of why huge RPCs might require unique consideration in the server-side log execution. [2 marks] (e) RPC conventions and compose ahead logging both depend on remarkable ID numbers. Make sense of why reusing client-created RPC IDs for server log exchange IDs could hurt every one of accuracy, versatility, and security. [6 marks]

(a) Write unchanging Java class Complex that addresses an intricate number with whole number genuine and nonexistent parts. [Note: Your class ought to contain just strategies that are fundamental for its utilization. Consolidate no numerical activities in the class.] [4 marks] (b) Without utilizing Generics, adjust the class to help the utilization of inconsistent kinds to store the genuine and nonexistent parts. Give three impediments of this methodology and remark on the changelessness of the new class. [7 marks] (c) Rewrite your class from part (b) utilizing Generics. Talk about the degree to which this new form resolves the issues distinguished to some extent (b). [7 marks] (d) Explain cautiously why the accompanying code can't be utilized to print out an object of type LinkedList>. You might expect the presence of a functioning print technique inside every Complex item. void printAll(LinkedList> list) { for (Complex c : list) c.print();

Cons aggregate prize, an approach, and an ideal strategy for an issue of this sort. [5 marks] (b) Give a definite induction of the Q-learning calculation. [5 marks] (c) In the support learning issue displayed in the graph, states are positions on a network and activities are down and right. The underlying state is s1. The main way a specialist can get a (non-zero) reward is by moving into one of two extraordinary positions, one of which has reward 50 and the other 150. s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 150 50 A potential grouping of activities (succession 1) is shown by strong bolts, and another (arrangement 2) by ran bolts. Accept that all Q values are initialised at 0. Make sense of how the Q values are changed by the Q-learning calculation assuming that succession 1 is utilized once, trailed by two purposes of grouping 2, and afterward one last utilization of arrangement 1. [10 marks]

The accompanying code has been composed by an amateur Java software engineer. You are not needed either to comprehend or to investigate the subtleties of how this code draws some specific example (a "Mythical serpent"). The software engineer observes that the Java compiler whines. Distinguish any mistakes and remark on any issues that (regardless of whether not stringently invalid Java) are responsible to create some issues. You are not expected to give corrections.pper class Dragon expands JApplet tosses Exception { import javax.swing.*; public paint(Graphics g) { this.g = g; drawDragon(DRAWDEPTH,100,200,300,200); }/** @title: drawDragon Function to draw a mythical beast bend between too focuses (x1,y1) and (x2,y2) with 'profundity'. */void safeguarded drawDargon(int profundity, int x1,int y1,int x2,int y2) { if (x1 < 0 | x2 < 0) if (y1 < 0) raise new Exception("X and Y < 0"); else assert("Ok up to this point"); if (profundity = 0)//lower part of recursion { (y2+y1-x2+x1)/2; ... also, Y coord. */printf("DEBUG: x= drawDragon(depth-1,mpx,mpy,x1,y1); drawDragon(depth+1,mpx,mpy,x2,y2); } static mystery int DRAWDEPTH=15, Graphics g;

(a) Show how you would make Java cluster of 1000 number qualities. [1 mark] (b) The qualities in a cluster could be utilized to address digits in the decimal portrayal of a number. For instance, the number 1 7 has decimal portrayal 0.142857 . . . also, that could be put away in an exhibit whose components began {1, 4, 2, . . .}. For a number put away that way compose code that duplicates the number by a given number, returning the entire number piece of the outcome and leaving the exhibit refreshed to hold the partial piece of the item. [5 marks] (c) To change a division over to a portrayal base 16 (for example hexadecimal) you can duplicate it by 16, and the subsequent number part is the primary digit of the base-16 portrayal. Increasing the division left over by 16 gets the subsequent digit, etc. Compose technique that acknowledges a variety of digits (base 10) and makes and returns another exhibit addressing a similar portion yet presently base 16. Your code ought to work for any length input exhibit, not only one of length 1000, and you might cause the result cluster to have a similar length as your feedback exhibit. [6 marks] (d) Suppose the contribution to your technique to some extent (c) was of length 1000 and gotten going with the decimal digits of 1 7 in it. Albeit the underlying digits in the result exhibit are the right hexadecimal portrayal of 1 7 the last barely any wind up looking odd. Make sense of. [3 marks] (e) One method for guaranteeing that mathematical outcomes are right is to utilize span number-crunching. A worth is addressed as a couple of clusters, one addressing a number not exactly (or equivalent to) the genuine worth and one a worth more prominent than it. So if utilizing 6 decimal places the number 1 7 would be held as a couple { If the two last digits contrast by all things considered 1 then the more modest of them can be seen as completely exact. Utilizing this thought, compose code that acknowledges a part in decimal structure and returns a vector meaning a similar worth in another base n (presently as of now not really 16) to such an extent that every one of the digits in the outcome vector are right. Clearness in your code is to be liked to execution, yet on the off chance that you know about specific manners by which the code you present is especially wasteful, you ought to note and make sense of them

For every one of the accompanying sets of ideas that are utilized in Java make sense of likenesses and contrasts and talk about when you would utilize one rather tha

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions