<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kavyareddysureddy</title>
    <description>The latest articles on DEV Community by kavyareddysureddy (@kavyareddysureddy).</description>
    <link>https://dev.to/kavyareddysureddy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F628913%2Fa65aff30-b7ce-429a-af8e-22857899a0ae.png</url>
      <title>DEV Community: kavyareddysureddy</title>
      <link>https://dev.to/kavyareddysureddy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kavyareddysureddy"/>
    <language>en</language>
    <item>
      <title>GRAPHS IN R PROGRAMMING</title>
      <dc:creator>kavyareddysureddy</dc:creator>
      <pubDate>Thu, 25 Nov 2021 12:03:08 +0000</pubDate>
      <link>https://dev.to/kavyareddysureddy/graphs-in-r-programming-22b7</link>
      <guid>https://dev.to/kavyareddysureddy/graphs-in-r-programming-22b7</guid>
      <description>&lt;h1&gt;
  
  
  Creating Graphs
&lt;/h1&gt;

&lt;p&gt;R is profoundly used for its substantial techniques for graphical interpretation of data of utmost importance of analysts. The primary styles are: dot plot, density plot (can be classified as histograms and kernel), line graphs, bar graphs (stacked, grouped and simple), pie charts (3D,simple and expounded), line graphs(3D,simple and expounded), box-plots(simple, notched and violin plots),    bar-plots and scatter-plots (simple with fit lines, scatter-plot matrices, high-density plots and 3-D plots).The foundational function for creating graphs: plot(). This includes how to build a graph, from adding lines and points to attaching a legend.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Workhorse of R Base Graphics The plot() Function
&lt;/h1&gt;

&lt;p&gt;The plot() function forms the foundation for much of R’s base&lt;br&gt;
graphing operations, serving as the vehicle for producing many&lt;br&gt;
different kinds of graphs. plot() is a generic function, or a&lt;br&gt;
placeholder for a family of functions. The function that is&lt;br&gt;
actually called depends on the class of the object on which it is called. The basic syntax to create a line chart in R is −&lt;/p&gt;

&lt;h2&gt;
  
  
  plot(v, type, col, xlab, ylab)
&lt;/h2&gt;

&lt;p&gt;Following is the description of the parameters used −&lt;br&gt;
-&amp;gt;v :is a vector containing the numeric values.&lt;br&gt;
-&amp;gt;type :takes the value "p" to draw only the points, "l" to draw only the lines and "o" to draw&lt;br&gt;
both points and lines.&lt;br&gt;
-&amp;gt;xlab :is the label for x axis.&lt;br&gt;
-&amp;gt;ylab :is the label for y axis.&lt;br&gt;
-&amp;gt;main :is the Title of the chart.&lt;br&gt;
-&amp;gt;col :is used to give colors to both the points and lines. &lt;/p&gt;

&lt;h1&gt;
  
  
  Some of the coloring functions in Graphs.
&lt;/h1&gt;

&lt;p&gt;Function       Use&lt;br&gt;
colors( )     Returns the built-in color names &lt;br&gt;
rgb( )        This function creates colors corresponding to the &lt;br&gt;
              given of the red, green and blue primaries. It &lt;br&gt;
              returns hex code of the color.&lt;br&gt;
cm.colors( )  Create a vector of n contiguous colors.&lt;br&gt;
rainbow( )    Create a vector of n contiguous colors.&lt;/p&gt;

&lt;p&gt;and so on...&lt;/p&gt;

&lt;h1&gt;
  
  
  TYPES OF GRAPHS:
&lt;/h1&gt;

&lt;p&gt;-Bar plot&lt;br&gt;&lt;br&gt;
    -Syntax:- barplot(H, xlab, ylab, main, names.arg, col)&lt;br&gt;
         Following is the description of the parameters used − &lt;br&gt;
           -H is a vector or matrix containing numeric values &lt;br&gt;
            used in bar chart. &lt;br&gt;
           - xlab is the label for x axis. &lt;br&gt;
           -ylab is the label for y axis. &lt;br&gt;
           -main is the title of the bar chart. &lt;br&gt;
           -names.arg is a vector of names appearing under each &lt;br&gt;
            bar. &lt;br&gt;
           -col is used to give colors to the bars in the &lt;br&gt;
            graph. &lt;br&gt;
-Pie Chart &lt;br&gt;
     -Syntax:- pie(x, labels, radius, main, col, clockwise)&lt;br&gt;
         Following is the description of the parameters used: &lt;br&gt;
             -x is a vector containing the numeric values used &lt;br&gt;
              in the pie chart. &lt;br&gt;
             - labels is used to give description to the &lt;br&gt;
               slices.&lt;br&gt;
             -radius indicates the radius of the circle of the &lt;br&gt;
              pie chart.(value between −1 and +1).&lt;br&gt;
             -main indicates the title of the chart.&lt;br&gt;
             -col indicates the color palette.&lt;br&gt;
             -clockwise is a logical value indicating if the &lt;br&gt;
              slices are drawn clockwise or anti clockwise.&lt;br&gt;
-Histogram&lt;br&gt;
     -Syntax:- hist(v,main,xlab,xlim,ylim,breaks,col,border)&lt;br&gt;
          Following is the description of the parameters used − &lt;br&gt;
             -v is a vector containing numeric values used in &lt;br&gt;
              histogram.&lt;br&gt;
             -main indicates title of the chart.  col is used &lt;br&gt;
              to set color of the bars.&lt;br&gt;
             -border is used to set border color of each bar. &lt;br&gt;
             -xlab is used to give description of x-axis. &lt;br&gt;
             -xlim is used to specify the range of values on &lt;br&gt;
              the x-axis.&lt;br&gt;
             -ylim is used to specify the range of values on &lt;br&gt;
              the y-axis.&lt;br&gt;
             -breaks is used to mention breakpoints between &lt;br&gt;
              histogram cells &lt;br&gt;
             -counts: The count of values in a particular &lt;br&gt;
              range. &lt;br&gt;
             -mids: center point of multiple cells.&lt;br&gt;
             -density: cell density &lt;/p&gt;

</description>
      <category>datascience</category>
      <category>programming</category>
      <category>r</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>PAGING IN OPERATING SYSTEM</title>
      <dc:creator>kavyareddysureddy</dc:creator>
      <pubDate>Wed, 12 May 2021 08:52:58 +0000</pubDate>
      <link>https://dev.to/kavyareddysureddy/paging-in-operating-system-30p6</link>
      <guid>https://dev.to/kavyareddysureddy/paging-in-operating-system-30p6</guid>
      <description>&lt;p&gt;PAGE REPLACEMENT:&lt;br&gt;
-&amp;gt;Prevent over-allocation of memory by modifying page-fault service routine to include page replacement&lt;br&gt;
-&amp;gt;Use modify (dirty) bit to reduce overhead of page transfers – only modified pages are written to disk&lt;/p&gt;

&lt;h1&gt;
  
  
  -&amp;gt;Page replacement completes separation between logical memory and physical memory – large virtual memory can be provided on a smaller physical memory
&lt;/h1&gt;

&lt;p&gt;Basic Page Replacement:&lt;br&gt;
1.Find the location of the desired page on disk&lt;br&gt;
2.Find a free frame:&lt;br&gt;
-If there is a free frame, use it &lt;br&gt;
-If there is no free frame, use a page replacement algorithm to select a victim frame&lt;br&gt;
-Write victim frame to disk if dirty&lt;br&gt;
3.Bring  the desired page into the (newly) free frame; update the page and frame tables&lt;br&gt;
4.Continue the process by restarting the instruction that caused the trap&lt;/p&gt;

&lt;h1&gt;
  
  
  =&amp;gt;Note now potentially 2 page transfers for page fault – increasing EAT
&lt;/h1&gt;

&lt;p&gt;Page and Frame Replacement Algorithms:&lt;br&gt;
=&amp;gt;Frame-allocation algorithm determines &lt;br&gt;
-How many frames to give each process&lt;br&gt;
-Which frames to replace&lt;br&gt;
=&amp;gt;Page-replacement algorithm&lt;br&gt;
-Want lowest page-fault rate on both first access and re-access&lt;br&gt;
=&amp;gt;Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number of page faults on that string&lt;br&gt;
-String is just page numbers, not full addresses&lt;br&gt;
-Repeated access to the same page does not cause a page fault&lt;/p&gt;

&lt;h1&gt;
  
  
  -Results depend on number of frames available
&lt;/h1&gt;

&lt;p&gt;Page Replacement Algorithms:&lt;br&gt;
-FIFO&lt;br&gt;
-OPTIMAL REPLACEMENT&lt;br&gt;
-LRU REPLACEMENT&lt;/p&gt;

&lt;h1&gt;
  
  
  -SECOND CHANCE PAGE REPLACEMENT
&lt;/h1&gt;

&lt;p&gt;-FIFO:First In First Out (FIFO) –&lt;br&gt;
This is the simplest page replacement algorithm. In this algorithm, the operating system keeps track of all pages in the memory in a queue, the oldest page is in the front of the queue. When a page needs to be replaced page in the front of the queue is selected for removal.&lt;br&gt;
-OPTIMAL REPLACEMENT:&lt;br&gt;
In this algorithm, pages are replaced which would not be used for the longest duration of time in the future.&lt;br&gt;
-LRU REPLACEMENT:&lt;br&gt;
Least Recently Used –In this algorithm page will be replaced which is least recently used.&lt;br&gt;
-SECOND CHANCE PAGE REPLACEMENT:&lt;br&gt;
the Second Chance replacement policy is called the Clock replacement policy.&lt;br&gt;
In the Second Chance page replacement policy, the candidate pages for removal are consider in a round robin matter, and a page that has been accessed between consecutive considerations will not be replaced.The page replaced is the one that - considered in a round robin matter - has not been accessed since its last consideration.&lt;/p&gt;

</description>
      <category>operatingsystems</category>
      <category>paging</category>
      <category>pagereplacement</category>
      <category>fifo</category>
    </item>
    <item>
      <title>DISK SCHEDULING IN OPERATING SYSTEM</title>
      <dc:creator>kavyareddysureddy</dc:creator>
      <pubDate>Mon, 10 May 2021 15:26:06 +0000</pubDate>
      <link>https://dev.to/kavyareddysureddy/disk-scheduling-in-operating-system-3og3</link>
      <guid>https://dev.to/kavyareddysureddy/disk-scheduling-in-operating-system-3og3</guid>
      <description>&lt;p&gt;DISK SCHEDULING IN OPERATING SYSTEM&lt;br&gt;
Disk Planning Algorithms Disk planning is done by working frameworks to plan I/O demands arriving for the disk. Disk planning is additionally known as I/O scheduling. Disk planning is vital because: Multiple I/O demands may arrive by diverse forms and as it were one I/O ask can be served at a time by the disk controller. Thus other I/O demands have to be hold up within the holding up line and got to be scheduled. Two or more ask may be far from each other so can result in more noteworthy disk arm movement. Hard drives are one of the slowest parts of the computer framework and in this way ought to be gotten to in an proficient manner. There are numerous Disk Planning Calculations but some time recently talking about them let’s have a speedy see at a few of the imperative terms: Seek Time: Seek time is the time taken to find the disk arm to a indicated track where the information is to be studied or compose. So the disk planning calculation that gives least normal look for time is better. Rotational Idleness: Rotational Latency is the time taken by the desired sector of disk to rotate into a position so that it can access the read/write heads. So the disk scheduling algorithm that gives minimum rotational latency is better. Rotational Latency: Rotational Latency is the time taken by the desired sector of disk to rotate into a position so that it can access the read/write heads. So the disk scheduling algorithm that gives minimum rotational latency is better. Transfer Time: Transfer time is the time to transfer the data. It depends on the rotating speed of the disk and number of bytes to be transferred. Disk Access Time: Disk Access Time is: Disk Access Time = Seek Time + Rotational Latency + Transfer Time. Disk Response Time: Response Time is the average of time spent by a request waiting to perform its I/O operation. Average Response time is the response time of the all requests. Variance Response Time is measure of how individual request are serviced with respect to average response time. So the disk scheduling algorithm that gives minimum variance response time is better. Disk scheduling algorithms: &lt;br&gt;
1.FCFS &lt;br&gt;
2.SSTF &lt;br&gt;
3.SCAN &lt;br&gt;
4.CSCAN &lt;br&gt;
5.LOOK &lt;/p&gt;

&lt;h2&gt;
  
  
  6.CLOOK
&lt;/h2&gt;

&lt;p&gt;EXAMPLE: &lt;br&gt;
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. what is the total seek time for the following: 1.FCFS 2.SSTF 3.SCAN 4.CSCAN 5.LOOK 6.CLOOK &lt;br&gt;
solution:&lt;br&gt;
FCFS: First come First serve&lt;br&gt;
queue::30,85,90,100,105,110,135,145&amp;nbsp;&amp;nbsp;-&amp;gt;Total seek time=(100-30)+(85-30)+(85-90)+(100-90)+(105-100)+(110-105)+(135-110)+(145-135)=70+55+5+10+5+5+25+10=185&lt;br&gt;
SSTF: shortest seek time first&lt;br&gt;
queue::30,85,90,100,105,110,135,145&amp;nbsp;&amp;nbsp;-&amp;gt;Total seek time=(100-100)+(105-100)+(110-105)+(110-90)+(90-85)+(135-85)+(145-30)+(145-135)=0+5+5+20+5+50+10+115=210&lt;br&gt;
SCAN:&lt;br&gt;
queue::30,85,90,100,105,110,135,145&amp;nbsp;&amp;nbsp;-&amp;gt;Total seek time=(200-100)+(200-30)=100+170=270&lt;br&gt;
C-SCAN:&lt;br&gt;
queue::30,85,90,100,105,110,135,145&amp;nbsp;&amp;nbsp;-&amp;gt;Total seek time=(145-100)+(145-0)+(90-0)=45+140+90=280&lt;br&gt;
LOOK:&lt;br&gt;
queue::30,85,90,100,105,110,135,145&amp;nbsp;&amp;nbsp;-&amp;gt;Total seek time=(145-100)+(145-30)=45+115=160&lt;br&gt;
C-LOOK:&lt;br&gt;
queue::30,85,90,100,105,110,135,145&amp;nbsp;&amp;nbsp;-&amp;gt;Total seek time=(145-100)+(145-30)+(90-30)=45+115+60=220&lt;/p&gt;

</description>
      <category>operatingsystems</category>
      <category>diskscheduling</category>
    </item>
    <item>
      <title>POINTERS</title>
      <dc:creator>kavyareddysureddy</dc:creator>
      <pubDate>Mon, 10 May 2021 15:02:33 +0000</pubDate>
      <link>https://dev.to/kavyareddysureddy/pointers-ddo</link>
      <guid>https://dev.to/kavyareddysureddy/pointers-ddo</guid>
      <description>&lt;p&gt;Pointers in C are easy and fun to learn. Some C programming tasks are performed more easily with pointers, and other tasks, such as dynamic memory allocation, cannot be performed without using pointers. So it becomes necessary to learn pointers to become a perfect C programmer. Let's start learning them in simple and easy steps. As you know, every variable is a memory location and every memory location has its address defined which can be accessed using ampersand (&amp;amp;) operator, which denotes an address in memory. Consider the following example, which prints the address of the variables defined −&lt;/p&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;int main () {&lt;br&gt;
   int  var1;&lt;br&gt;
   char var2[10];&lt;br&gt;
   printf("Address of var1 variable: %x\n", &amp;amp;var1  );&lt;br&gt;
   printf("Address of var2 variable: %x\n", &amp;amp;var2  );&lt;br&gt;
   return 0;&lt;br&gt;
}&lt;br&gt;
When the above code is compiled and executed, it produces the following result −&lt;br&gt;
Address of var1 variable: bff5a400&lt;br&gt;
Address of var2 variable: bff5a3f6&lt;/p&gt;

&lt;p&gt;What are Pointers?&lt;br&gt;
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before using it to store any variable address. The general form of a pointer variable declaration is −&lt;br&gt;
type *var-name;&lt;/p&gt;

&lt;p&gt;Here, type is the pointer's base type; it must be a valid C data type and var-name is the name of the pointer variable. The asterisk * used to declare a pointer is the same asterisk used for multiplication. However, in this statement the asterisk is being used to designate a variable as a pointer. Take a look at some of the valid pointer declarations −&lt;br&gt;
int    &lt;em&gt;ip;    /&lt;/em&gt; pointer to an integer &lt;em&gt;/&lt;br&gt;
double *dp;    /&lt;/em&gt; pointer to a double &lt;em&gt;/&lt;br&gt;
float  *fp;    /&lt;/em&gt; pointer to a float &lt;em&gt;/&lt;br&gt;
char   *ch     /&lt;/em&gt; pointer to a character */&lt;br&gt;
The actual data type of the value of all pointers, whether integer, float, character, or otherwise, is the same, a long hexadecimal number that represents a memory address. The only difference between pointers of different data types is the data type of the variable or constant that the pointer points to.&lt;/p&gt;

&lt;p&gt;How to Use Pointers?&lt;/p&gt;

&lt;p&gt;There are a few important operations, which we will do with the help of pointers very frequently. (a) We define a pointer variable, (b) assign the address of a variable to a pointer and (c) finally access the value at the address available in the pointer variable. This is done by using unary operator * that returns the value of the variable located at the address specified by its operand. The following example makes use of these operations −&lt;/p&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;int main () {&lt;br&gt;
   int  var = 20;   /* actual variable declaration &lt;em&gt;/&lt;br&gt;
   int  *ip;        /&lt;/em&gt; pointer variable declaration &lt;em&gt;/&lt;br&gt;
   ip = &amp;amp;var;  /&lt;/em&gt; store address of var in pointer variable*/&lt;br&gt;
   printf("Address of var variable: %x\n", &amp;amp;var  );&lt;br&gt;
   /* address stored in pointer variable &lt;em&gt;/&lt;br&gt;
   printf("Address stored in ip variable: %x\n", ip );&lt;br&gt;
   /&lt;/em&gt; access the value using the pointer */&lt;br&gt;
   printf("Value of *ip variable: %d\n", *ip );&lt;br&gt;
   return 0;&lt;br&gt;
}&lt;br&gt;
When the above code is compiled and executed, it produces the following result −&lt;br&gt;
Address of var variable: bffd8b3c&lt;br&gt;
Address stored in ip variable: bffd8b3c&lt;br&gt;
Value of *ip variable: 20&lt;/p&gt;

&lt;p&gt;NULL Pointers&lt;br&gt;
It is always a good practice to assign a NULL value to a pointer variable in case you do not have an exact address to be assigned. This is done at the time of variable declaration. A pointer that is assigned NULL is called a null pointer.&lt;br&gt;
The NULL pointer is a constant with a value of zero defined in several standard libraries. Consider the following program −&lt;/p&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;int main () {&lt;br&gt;
   int  &lt;em&gt;ptr = NULL;&lt;br&gt;
   printf("The value of ptr is : %x\n", ptr  );&lt;br&gt;
   return 0;&lt;br&gt;
}&lt;br&gt;
When the above code is compiled and executed, it produces the following result −&lt;br&gt;
The value of ptr is 0&lt;br&gt;
In most of the operating systems, programs are not permitted to access memory at address 0 because that memory is reserved by the operating system. However, the memory address 0 has special significance; it signals that the pointer is not intended to point to an accessible memory location. But by convention, if a pointer contains the null (zero) value, it is assumed to point to nothing.&lt;br&gt;
To check for a null pointer, you can use an 'if' statement as follows −&lt;br&gt;
if(ptr)     /&lt;/em&gt; succeeds if p is not null &lt;em&gt;/&lt;br&gt;
if(!ptr)    /&lt;/em&gt; succeeds if p is null */&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
