Saturday 7 November 2020

All html tags

  

TagDescription
<!--...-->Defines a comment
<!DOCTYPE> Defines the document type
<a>Defines a hyperlink
<abbr>Defines an abbreviation or an acronym
<acronym>Not supported in HTML5. Use <abbr> instead.
Defines an acronym
<address>Defines contact information for the author/owner of a document
<applet>Not supported in HTML5. Use <embed> or <object> instead.
Defines an embedded applet
<area>Defines an area inside an image map
<article>Defines an article
<aside>Defines content aside from the page content
<audio>Defines embedded sound content
<b>Defines bold text
<base>Specifies the base URL/target for all relative URLs in a document
<basefont>Not supported in HTML5. Use CSS instead.
Specifies a default color, size, and font for all text in a document
<bdi>Isolates a part of text that might be formatted in a different direction from other text outside it
<bdo>Overrides the current text direction
<big>Not supported in HTML5. Use CSS instead.
Defines big text
<blockquote>Defines a section that is quoted from another source
<body>Defines the document's body
<br>Defines a single line break
<button>Defines a clickable button
<canvas>Used to draw graphics, on the fly, via scripting (usually JavaScript)
<caption>Defines a table caption
<center>Not supported in HTML5. Use CSS instead.
Defines centered text
<cite>Defines the title of a work
<code>Defines a piece of computer code
<col>Specifies column properties for each column within a <colgroup> element 
<colgroup>Specifies a group of one or more columns in a table for formatting
<data>Adds a machine-readable translation of a given content
<datalist>Specifies a list of pre-defined options for input controls
<dd>Defines a description/value of a term in a description list
<del>Defines text that has been deleted from a document
<details>Defines additional details that the user can view or hide
<dfn>Specifies a term that is going to be defined within the content
<dialog>Defines a dialog box or window
<dir>Not supported in HTML5. Use <ul> instead.
Defines a directory list
<div>Defines a section in a document
<dl>Defines a description list
<dt>Defines a term/name in a description list
<em>Defines emphasized text 
<embed>Defines a container for an external application
<fieldset>Groups related elements in a form
<figcaption>Defines a caption for a <figure> element
<figure>Specifies self-contained content
<font>Not supported in HTML5. Use CSS instead.
Defines font, color, and size for text
<footer>Defines a footer for a document or section
<form>Defines an HTML form for user input
<frame>Not supported in HTML5.
Defines a window (a frame) in a frameset
<frameset>Not supported in HTML5.
Defines a set of frames
<h1> to <h6>Defines HTML headings
<head>Contains metadata/information for the document
<header>Defines a header for a document or section
<hr>Defines a thematic change in the content
<html>Defines the root of an HTML document
<i>Defines a part of text in an alternate voice or mood
<iframe>Defines an inline frame
<img>Defines an image
<input>Defines an input control
<ins>Defines a text that has been inserted into a document
<kbd>Defines keyboard input
<label>Defines a label for an <input> element
<legend>Defines a caption for a <fieldset> element
<li>Defines a list item
<link>Defines the relationship between a document and an external resource (most used to link to style sheets)
<main>Specifies the main content of a document
<map>Defines an image map
<mark>Defines marked/highlighted text
<meta>Defines metadata about an HTML document
<meter>Defines a scalar measurement within a known range (a gauge)
<nav>Defines navigation links
<noframes>Not supported in HTML5.
Defines an alternate content for users that do not support frames
<noscript>Defines an alternate content for users that do not support client-side scripts
<object>Defines a container for an external application
<ol>Defines an ordered list
<optgroup>Defines a group of related options in a drop-down list
<option>Defines an option in a drop-down list
<output>Defines the result of a calculation
<p>Defines a paragraph
<param>Defines a parameter for an object
<picture>Defines a container for multiple image resources
<pre>Defines preformatted text
<progress>Represents the progress of a task
<q>Defines a short quotation
<rp>Defines what to show in browsers that do not support ruby annotations
<rt>Defines an explanation/pronunciation of characters (for East Asian typography)
<ruby>Defines a ruby annotation (for East Asian typography)
<s>Defines text that is no longer correct
<samp>Defines sample output from a computer program
<script>Defines a client-side script
<section>Defines a section in a document
<select>Defines a drop-down list
<small>Defines smaller text
<source>Defines multiple media resources for media elements (<video> and <audio>)
<span>Defines a section in a document
<strike>Not supported in HTML5. Use <del> or <s> instead.
Defines strikethrough text
<strong>Defines important text
<style>Defines style information for a document
<sub>Defines subscripted text
<summary>Defines a visible heading for a <details> element
<sup>Defines superscripted text
<svg>Defines a container for SVG graphics
<table>Defines a table
<tbody>Groups the body content in a table
<td>Defines a cell in a table
<template>Defines a container for content that should be hidden when the page loads
<textarea>Defines a multiline input control (text area)
<tfoot>Groups the footer content in a table
<th>Defines a header cell in a table
<thead>Groups the header content in a table
<time>Defines a specific time (or datetime)
<title>Defines a title for the document
<tr>Defines a row in a table
<track>Defines text tracks for media elements (<video> and <audio>)
<tt>Not supported in HTML5. Use CSS instead.
Defines teletype text
<u>Defines some text that is unarticulated and styled differently from normal text
<ul>Defines an unordered list
<var>Defines a variable
<video>Defines embedded video content
<wbr>Defines a possible line-break

Friday 23 October 2020

PRACTICE PROBLEMS BASED ON BANKER’S ALGORITHM

 

Problem-01:


Considering a system with four processes P0 through P3 and three resources of type A, B, C. Resource type A has 10 instances, B has 5 instances and type C has 7 instances. Suppose at time t0 following snapshot of the system has been taken:





Question1. What will be the content of the Need matrix?

Question2.  Is the system in a safe state? If Yes, then what is the safe sequence?

Problem-02:


Question1. What will be the content of the Need matrix?

Question2.  Is the system in a safe state? If Yes, then what is the safe sequence?

Question3. What will happen if process Prequests one additional instance of resource type A and two instances of resource type C?


Problem-03:

 

A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Which of these processes will finish LAST?

  1. P0
  2. P1
  3. P2
  4. None of the above since the system is in a deadlock



Problem-04:

 

An operating system uses the banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y and Z to three processes P0, P1 and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

AllocationMax
XYZXYZ
P0001843
P1320620
P2211333

 

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in safe state. Consider the following independent requests for additional resources in the current state-

 

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z

REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

 

Which of the following is TRUE?

  1. Only REQ1 can be permitted
  2. Only REQ2 can be permitted
  3. Both REQ1 and REQ2 can be permitted
  4. Neither REQ1 nor REQ2 can be permitted


Problem-05:

 

A system has 4 processes and 5 allocatable resource. The current allocation and maximum needs are as follows-

AllocatedMaximum
A1021111213
B2011022210
C1101121311
D1111011220

 

If Available = [ 0 0 X 1 1 ], what is the smallest value of x for which this is a safe state?


Problem-06:

An operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

GATECS2014Q42

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is
currently in a safe state. Consider the following independent requests for additional resources in the
current state:

REQ1: P0 requests 0 units of X,  
      0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X, 
      0 units of Y and 0 units of Z

Which one of the following is TRUE?
(A) Only REQ1 can be permitted.
(B) Only REQ2 can be permitted.
(C) Both REQ1 and REQ2 can be permitted.
(D) Neither REQ1 nor REQ2 can be permitted


Problem-07:


 A system has 12 magnetic tape drives and 3 processes : P0, P1, and P2. Process P0 requires 10 tape drives, P1 requires 4 and P2 requires 9 tape drives.

Process    
P0            
P1                             
P2                             
 
Maximum needs (process-wise: P0 through P2 top to bottom)    
10             
4   
9
 
Currently allocated (process-wise)
5
2
2

Which of the following sequence is a safe sequence?
a) P0, P1, P2
b) P1, P2, P0
c) P2, P0, P1
d) P1, P0, P2

Thursday 22 October 2020

Minimum number of resource for deadlock free system

 



Consider there are n processes in the system P1, P2, P3, …… , Pn where-


Process P1 requires x1 units of resource R

Process P2 requires x2 units of resource R

Process P3 requires x3 units of resource R and so on.


In worst case,


The number of units that each process holds = One less than its maximum demand

 


So,


Process P1 holds x1 – 1 units of resource R

Process P2 holds x2 – 1 units of resource R

Process P3 holds x3 – 1 units of resource R and so on.

 


Now,


Had there been one more unit of resource R in the system, system could be ensured deadlock free.

This is because that unit would be allocated to one of the processes and it would get execute and then release its units.


So, Maximum number of units of resource R that ensures deadlock


= (x1-1) + (x2-1) + (x3-1) + …. + (xn-1)


= ( x1 + x2 + x3 + …. + xn ) – n


= ∑xi – n


= Sum of max needs of all n processes – n


Minimum Number Of Units That Ensures No Deadlock-

 


Minimum number of units of resource R that ensures no deadlock


= One more than maximum number of units of resource R that ensures deadlock


= (∑xi – n) + 1



or 

R > = P * ( N - 1 ) + 1


Where R is the minimum number of resources

P is the number of processes

N Max need for each process


Deadlock Practice Questions:

 

1 - A system is having 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlock will occur-

  1. 3
  2. 5
  3. 4
  4. 6

2 - A system is having 10 user processes each requiring 3 units of resource R. The minimum number of units of R such that no deadlock will occur _____?


3 - A system is having 3 user processes P1, P2 and P3 where P1 requires 2 units of resource R, P2 requires 3 units of resource R, P3 requires 4 units of resource R. The minimum number of units of R that ensures no deadlock is _____?


4 - A system is having 3 user processes P1, P2 and P3 where P1 requires 21 units of resource R, P2 requires 31 units of resource R, P3 requires 41 units of resource R. The minimum number of units of R that ensures no deadlock is _____?


5 - If there are 6 units of resource R in the system and each process in the system requires 2 units of resource R, then how many processes can be present at maximum so that no deadlock will occur?


6 - If there are 6 units of resource R in the system and each process in the system requires 3 units of resource R, then how many processes can be present at maximum so that no deadlock will occur?


7 - If there are 100 units of resource R in the system and each process in the system requires 2 units of resource R, then how many processes can be present at maximum so that no deadlock will occur?


8 - If there are 100 units of resource R in the system and each process in the system requires 4 units of resource R, then how many processes can be present at maximum so that no deadlock will occur?


9 - If there are 100 units of resource R in the system and each process in the system requires 5 units of resource R, then how many processes can be present at maximum so that no deadlock will occur?


10 - A computer system has 6 tape drives with n processes competing for them. Each process needs 3 tape drives. The maximum value of n for which the system is guaranteed to be deadlock free-


11 - Consider a system having m resources of the same type. These resources are shared by 3 processes A, B and C which have peak demands of 3, 4 and 6 respectively. For what value of m, deadlock will not occur?

  1. 7
  2. 9
  3. 10
  4. 13

12 - Consider a system having m resources of the same type being shared by n processes. Resources can be requested and released by processes only one at a time. The system is deadlock free if and only if-

  1. The sum of all max needs is < m+n
  2. The sum of all max needs is > m+n
  3. Both of above
  4. None of these






Ans

  1. 4
  2. 21
  3. 7
  4. 91
  5. 5
  6. 2
  7. 99
  8. 33
  9. 24
  10. 2
  11. 13
  12. The sum of all max needs is < m+n