If you have road \'too far\' in a file - i.e. you need to \'back up\' within the
ID: 3861084 • Letter: I
Question
If you have road 'too far' in a file - i.e. you need to 'back up' within the file - what stop (s) would be necessary do this? (For instance, you've just read a line and realized after-the-fact that it wasn't 'your' data but that of the next 'record'. How do you tell the file to move back to the beginning of that line so that when the next object reads itself, that line will be available to be part of its data?) If you've already read through some/all of a file once, but now need to go back to the beginning to re-process the data, show the step(s) necessary to do so. (Be as efficient as possible) How might this change if the file had lines of comments at the beginning (before any of the data)? (Again, be efficient for your user's sake.) The designers of the stream classes failed to give us an ios base:: center format flag. Show how to center the string s in an output field w wide. Explain your formula briefly. In stream formatting the width of an output item is the only (temporary/persistent) formatting option. This option can be set with either the ____ method or the ____ manipulator. All other options (retain/lose/increment) their value until changed. For example, the number of decimal places to be displayed for a floating point number can be set with the ____ method. The justification can be set using one of the flags ____ (for inserting extra padding on the right side of data) ___ (for inserting extra padding on the left side of data), or ____ (the weird one which puts the sign of a number to the left of a column and the number itself to the right of the column). Even the character that is filled in when a width is too wide for the data can be set with the ____ method.Explanation / Answer
Please see the below answers.
Answer:
32)
If you have read “too far” in a file –I . e you need to back up within that file, in this situation we have to consider, that it is in deadlock.
If we do not read too far then there must be lose of synchronization between command or executable code & resulting output.
A deadlock is happened when regulate concurrent access to some resources, a deadlock situation is occurred in turn by each resources under this execution path, using same process .
Deadlock occurs when A has locked on resource R1 and waiting for resource R2 which is going to be released ;.
While B has lock on resourceR2 and waiting for resource R1 which is going to be released.
Prevention: A coordination between processes is essential to prevent deadlock and need some process to backup :
i) a single resource to be waited before entering in a deadlock section (single resource does not trigger deadlocks) ;
ii) an well synchronized order for resource locking, if dead lock happened then stop at that point of execution and restart from initial to get back up any loss of data.
Answer:
33)
These are the methods to reprocess data
First take a logical copy of all of the database with set up environment, having there internal process in a specified fixed location on the stand by database.
Take a copy of schema type information or catalog from database container to reprocess data.
Take a copy of database configuration information and archive file contents.
Take a copy of recovery file from history file content.
Reprocess & restore the file.
Answer :
34)
< iomanip> has the stream manipulators std::left, std::rightand std::internal, but if designer failed to give ios_base::center format flag, then either put std::center or centered(“ strings”) if header will be <iomanip>
It's used simply by calling centered("String")
int main(int argc, char *argv[]) {
std::cout << "|" << std::setw(10) << centered("computer")
<< "|" << std::setw(10) << centered("laptop")
<< "|" << std::setw(10) << centered("iphone") << "|"
<< std::endl;
}
Answer :
35)
i)Persistent , because these variables retain their values until they have been changed.
ii)Format() method.
format() methods for formatted Input and output streams which can be build from/to any data source.
iii)Stream maniupulator:
Manipulators are used to change formatting of streams by manipulating parameters and for inserting or extracting certain values or characters.
iv)Retain there values until changed. because these variables retain their values until they have been changed, few only temporarily retain for the upcoming operation.
viii) Integer.toString(123)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.