Friday 30 March 2012

W.A.P to implement Midpoint circle algorithm.



#include "graphics.h"
#include "stdlib.h"
#include "stdio.h"
#include "conio.h"
makeCircle(int,int,int,int);
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   //int midx, midy;
   //int radius = 100;
   int R,x,y,cx,cy,d;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }

   /*
   midx = getmaxx() / 2;
   midy = getmaxy() / 2;
   setcolor(getmaxcolor());

   draw the circle
   circle(midx, midy, radius);
   */

   //MidPoint Circle algorithm:
   printf("enter co-ordinates for center");
   scanf("%d,%d",&cx,&cy);
   printf("enter the radius:");
   scanf("%d",&R);
   x=0,y=R;
   d=1-R;
   while(y>x)
   {

   makeCircle(cx,cy,x,y);

   if(d<0)
   {
    d=d+(2*x)+1;
   }
   else
   {
    d=d+(2*(x-y))+1;
    y--;
   }
   x++;

    makeCircle(cx,cy,x,y);
   }
   /* clean up */
   getch();
   closegraph();
   return 0;
}
makeCircle(int cx,int cy,int x,int y)
{
    putpixel(cx+x,cy+y);
    putpixel(cx-x,cy+y);
    putpixel(cx+x,cy-y);
    putpixel(cx-x,cy-y);
    putpixel(cx+y,cy+x);
    putpixel(cx-y,cy+x);
    putpixel(cx+y,cy-x);
    putpixel(cx-y,cy-x);
}

Download it from here: https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnwwOWNlZ2l0fGd4OjY1MGQ1Y2NiYjc1ZWYxNDU 

News

Unfortunately the batches have been changed because of the detained students..
up to 090120107058 no. are in class A and from 090120107059 no. are in class B..
so kindly check your batch..





in Software Engineering lab we have to choose one problem on which we will have to build an application..
for that we have to submit our defination (2 pages max.) to respected lab faculty in next lab..
each student has to choose individual and different subject..




SEMI-FINAL:
3rd c.e. b VS 3rd m.e.
6th Feb. (Monday)
9am
3rd c.e. a VS 2nd m.e.
12pm
c.e. back to back... :)
so be present and shower your loving support for computer

Draw A Kite In C language

#include<stdio.h>
#include<graphics.h>
#include<alloc.h>
int main(void)
{
void *kite;
int s,x,y,gd=DETECT,gm,r;
initgraph(&gd,&gm,"c:\tc");
setcolor(10);
moveto(100,100);
lineto(125,75);
lineto(150,100);
lineto(120,130);
lineto(130,130);
lineto(125,125);
lineto(100,100);  //this completes the outline design of kite
setfillstyle(SOLID_FILL,BLUE);
floodfill(125,100,10);
floodfill(125,127,10);
arc(125,120,40,140,31);
line(125,125,125,75);
line(125,110,150,130);
line(125,94,150,130);

s=imagesize(100,75,150,130);
kite=(void*)malloc(s);

getimage(100,75,150,130,kite);
putimage(100,75,kite,XOR_PUT);
x=100,y=75;

while(!kbhit())
{
setcolor(10);
putimage(x,y,kite,XOR_PUT);
setcolor(YELLOW);
line(x+50,y+55,639,479);
delay(100);
putimage(x,y,kite,XOR_PUT);
setcolor(0);
line(x+50,y+55,639,479);

r=rand();

switch(r%4)
{
case 0:x=x+10; break;
case 1:x=x-10; break;
case 2:y=y+10; break;
case 3:y=y-10;break;
}
if(x>640) x-=40;
if(x<40) x+=40;
if(y>479) y-=40;
if(y<40) y+=40;
}
getch();
closegraph();
return 0;
}

What is the difference between Bug, Error and Defect?

Error:
The difference between expected result and actual result is error.
Is an undesirable deviation from requirements or Cosmetic.

Bug:
If that error comes at the tome of development stage before production then it is bug.
Is an error found BEFORE the application goes into production or missing Functionality.

Defect:
If that error comes after production then we say it is defect.
Is an error found AFTER the application goes into production or missing Requirement

How to solve Windows is not Genuine problem?


If you have a message that the windows is not genuine then
go to Start>
Control Panel>
Uninstall Programs>
Click on view installed updates>
Uninstall KB971033

PROTOCOLS and their PORTS


Ftp 21 Sftp,Ssh 22
Telnet 23
Smtp 25
Http,Php 80
Pop3 110
Irc 194
Https 443
Ftps 990

CS




Counter Strike 1.6 :-

Counter Strike Counter Strike (CS) 1.6 is a MOD for Half-Life that is set in a team play mode. An institution in first-person shooters, Counter Strike 1.6 is the most up to date version of the classic video game, with the Steam system providing bug fixes and updates.


cl_flushentitypacket :-

If you are getting CL_FlushEntityPacket Warnings this typically means that either:
  • Your internet connection or the server's internet connection is having problems.
  • Your connection is overloaded, for example running a peer-to-peer file-sharing application in the background.
  • There are other computers on your local network using your internet connection.
  • The server you are on has its network connection overloaded.
  • You are running on a wireless connection with a poor or inconsistent signal.
  • You have a Virus or Trojan or Internet Worm infection that is generating traffic.
  • You are connected to the internet using a dial-up or other low-speed connection.
  • You have your rate or cl_updaterate or cl_cmdrate settings too fast for your internet connection.

How to fix??
  1. set rate to 9000
  2. set cl_rate to 20000
  3. set cl_cmdrate to 30
  4. set cl_updaterate to 20
  5. set fps_max to 100
  6. set net_graph to 3