Saturday, June 29, 2013

CPU Scheduling Algorithm : Shortest Remaining Time [Version 2] C++


Hi guys, after the the first version of C implementation of CPU Scheduling Algorithm Shortest Remaining Time by my friend, here I present another version of it in C++, which is also a much shorter program than previous one..


#include<iostream.h>
#include<conio.h>
class pro
{
public:
    int id;
    int burstTime;
    float arrivalTime;
    int roundat;
};
class sch
{
public:
    int nop,rqsize,btsum,g[100],gt[100],tt[100];
    pro min;
    pro max;
    void getdata(pro p[100]);
    void putdata(pro p[100]);
    void round(pro p[100]);
    void srt(pro p[100],pro readyq[100],int minid);
    void gantt(pro p[100],int gt[100]);
};
void sch::getdata(pro p[100])
{
       cout<<"\nEnter No. of Processes=\t";
       cin>>nop;
       for(int i=1;i<=nop;i++)
       {
        cout<<"\nEnter burst time for P"<<i<<" =\t";
        cin>>p[i].burstTime;
        btsum=btsum+p[i].burstTime;
        cout<<"\nArrival Time for P"<<i<<" =\t";
        cin>>p[i].arrivalTime;
        p[i].id=i;
       }
 }

Sunday, September 16, 2012

3D Cube using HTML5 CSS3



3d cube using html5 css3
3D Cube using HTML5/Pure CSS3 No JavaScript

View Demo :  3D Cube using HTML5 and CSS3 no JavaScript

    Hello friends, here's nice and simple tutorial on how to build a 3D cube using HTML5/CSS3 with NO JavaScript coding. 

    As we know HTML5 is a new web emerging technology which features a lot of new improvements over HTML 4.1.Among these features, support for 2D/3D graphics is new , which is supported through following elements/css techniques:


  • by using the new CANVAS element/tag
  • by using the SVG (Scalable Vector Graphics) in HTML5
  • by using CSS3
  In this post I am going to focus on 3rd technique for creating and animating a 3D cube i.e using CSS3.

Tuesday, January 24, 2012

Image File Formats....(brief)

This is a small attempt to introduce some of the many image formats...

Image file formats

Images!!!...there are many...
Image file formats are standardized means of organizing and storing digital images. Image files are composed of pixels, vector (geometric) data, or a combination of the two. Whatever the format, the files are rasterized to pixels when displayed on most graphic displays. The pixels that constitute an image are ordered as a grid (columns and rows); each pixel consists of numbers representing magnitudes of brightness and color.

Image file sizes

Image file size—expressed as the number of bytes—increases with the number of pixels composing an image, and the color depth of the pixels. The greater the number of rows and columns, the greater is the image resolution, and the larger is the file. Also, each pixel of an image increases in size when its color depth increases—an 8-bit pixel (1 byte) stores 256 colors, a 24-bit pixel (3 bytes) stores 16 million colors, the latter known as truecolor.
Image compression uses algorithms to decrease the size of a file. High resolution cameras produce large image files, ranging from hundreds of kilobytes to megabytes, per the camera's resolution and the image-storage format capacity. High resolution digital cameras record 12 megapixel (1MP = 1,000,000 pixels / 1 million) images, or more, in truecolor. For example, an image recorded by a 12 MP camera; since each pixel uses 3 bytes to record truecolor, the uncompressed image would occupy 36,000,000 bytes of memory—a great amount of digital storage for one image, given that cameras must record and store many images to be practical. Faced with large file sizes, both within the camera and a storage disc, image file formats were developed to store such large images. An overview of the major graphic file formats follows below.

Image file compression

There are two types of image file compression algorithms: lossless and lossy.

1.      Lossless compression algorithms reduce file size without losing image quality, though they are not compressed into as small a file as a lossy compression file. When image quality is valued above file size, lossless algorithms are typically chosen.