Tuesday 23 August 2011

How to create a Digital clock in C++


code:


#include<stdio.h>
#include<process.h>
#include<iostream.h>
#include<dos.h>
#include<graphics.h>
#include<conio.h>
#include<math.h>
void draw()
{
setbkcolor(0);
setlinestyle(0,0,0);
setcolor(9);
circle(320,240,3);
setcolor(11);
setfillstyle(6,13);
circle(320,240,150);
circle(320,240,165);
floodfill(156,242,11);
settextstyle(2,0,5);
setcolor(14);
outtextxy(314,98,"12");
outtextxy(384,114,"1");
outtextxy(434,163,"2");
outtextxy(454,230,"3");
outtextxy(317,369,"6");
outtextxy(177,230,"9");
outtextxy(436,300,"4");
outtextxy(195,302,"8");
outtextxy(195,163,"10");
outtextxy(244,112,"11");
outtextxy(388,353,"5");
outtextxy(248,353,"7");
}
main()
{

int gd=0,gm;
initgraph(&gd,&gm,"c:\tc\bgi");

draw();
//line(320,240,320,130);
//line(320,240,320,150);
//getch();
float s;
float df;
//s=282*M_PI/180;
//float angle=4.712389;
//float an=4.712389;
float anf=4.712389;

//float angle=0;
int x,y;
int q,w;
int ta,d;

float as;
as=6*M_PI/180;

int c2=0;
int count=0;
struct  time t;
gettime(&t);
float angle=4.712389+t.ti_sec*.1047198;
float an=4.712389+t.ti_min*.1047198;
while(!kbhit())
{
draw();
gettime(&t);
gotoxy(5,5);
angle=4.712389+t.ti_sec*.1047198;
an=4.712389+t.ti_min*.1047198;
anf=4.712389+t.ti_hour*5*.1047198 ;
if(t.ti_min>=12&&t.ti_min<24)
{
anf=anf+2*.1047198;
}
if(t.ti_min>=24&&t.ti_min<36)
{
anf=anf+(3*.1047198);
}
if(t.ti_min>=36&&t.ti_min<48)
{
anf=anf+(4*.1047198);
}
if(t.ti_min>=48&&t.ti_min<60)
{
anf=anf+(5*.1047198);
}


gotoxy(2,2);
printf("The current time is: %d: %d: %d
",
       t.ti_hour, t.ti_min, t.ti_sec, t.ti_hund);

cout<<"   ";
setlinestyle(0,0,0);
setcolor(0);
line(320,240,x,y);
line(320,240,q,w);
line(320,240,ta,d);

x=320+140*cos(angle);
y=240+140*sin(angle);
q=320+122*cos(an);
w=240+122*sin(an);
ta=320+86*cos(anf);
d=240+86*sin(anf);
setcolor(10);
setlinestyle(0,0,0);
line(320,240,x,y);
setlinestyle(0,0,2);
setcolor(9);
line(320,240,q,w);
setlinestyle(0,0,3);
setcolor(4);
line(320,240,ta,d);
angle+=.1047198;
delay(1000);
count++;

/*if(c2==12)
{
setlinestyle(0,0,3);
c2=0;
anf+=.1047198;
} */
setcolor(count);
outtextxy(370,440,"MADE BY :- AAYUSH AWASTHI");
outtextxy(390,460,"BCA IIIrd YEAR");

}


getch();
}

How to insert YouTube movies into PowerPoint slides...


You can insert the YouTube movies into your PowerPoint slides to express your idea or better way to communicate something.You can convey these ideas in more effective ways, if you are using movie files with your simple slides.
Follow the given steps to add YouTube movies into PowerPoint slides:
First of all download the YouTube.com movies and then save on your computer hard drive. Mostly movies are available in flash video file format on YouTube site. You can convert also the downloaded movies from YouTube into any common format, for example, windows media video file (wmv), windows video file (avi) and movie file (mpeg).
First of all open the presentation in which you want to insert movie file.

Now click on "Movies and Sounds" option from the Insert" menu and choose the option "Movie from File".
Now select your movie that you want to insert into slide and click on Ok button.
Here now you are asked "Do you want your movie to play automatically in the slide show? If not, it will play when you click it."
Recommend choosing Ok button to play automatically even if you want the movie to play when clicked.
Finally save your PowerPoint presentation and run it for test.

How to create One-Click Shutdown icon on your desktop?

You can shutdown your computer with a single click on the desktop shutdown icon. You can set the time when your computer starts the shutdown process. A simple click on shutdown icon, close the all running applications and start shutting down properly after predefined time. This tip is very useful to save energy and time. After the execution of this command, a small window will appear to start count time of system shutdown.



Follow the given steps to create the shutdown icon:
To create a new shortcut, right click on any empty area of your desktop and go to New then Shortcut.
Now a small windows dialog box will appear with the title “Create Windows”. In the “Create Shortcut” window, type the following command.
SHUTDOWN -s -t 30

Here t 30 mean time in second, for example if you want your computer will shutdown automatically after half minute then the command will be shutdown -s -t 30.
Click Next button to type the name of this shortcut and press Finish to close it.
At the end, when you click on shutdown icon, a windows dialog box will appear with the information” This system is shutting down. Please save all work in progress and log off. Any unsaved changes will be lost. This shutdown was initiated by administrator”.

How to accept Track changes in Microsoft Word 2010?


Track changes" is wonderful and remarkable tool of Microsoft Word 2010. The feature allows editing your documents without making the changes permanent. It means if you have deleted a word, Track back highlights it, though the word is deleted but until final changes are accepted, it remains there. A track change is very helpful when you are working on draft that needs extra care. For Example you are working your project and you are not sure whether changes you made are right and you want to take your professors/superiors opinion.
Today the world has become global village, now virtual teams sitting in different parts of world are working on same projects. They need to communicate, they suggest prose and finalize things, track changes help them to make changes or send suggestions to other members.
One can delete, add, comment or make formatting changes by using it.
Instructions
Open desired word document you wish to apply track changes.
2.       Go to Review Tab, under "Tracking" Group, click on track changes. It will change to orange colour, that means feature has "turned on". 
      
3.       Take the cursor to where you want to save changes and type, you will see colour of the text will different. It means that changes you are making are not permanent.  
      
4.       Go to "Tracking Group" and click on "Show Markup", choose "Balloons" and Click on your desired settings how you want to show your changes. Either you want to show your changes/Revisions in Balloons, with in your document or show only comments and Formatting in Balloons. 
      
5.       Go to "Comments" Group, under Review tab, click "New comment" where you want to insert a comment, leave a note or ask question.  
      
6.       Go to the Review Group, click on the Reviewing pane and choose either vertical or horizontal settings to carefully go through your document. OR go through them one by one by choosing "Next" or "Previous" from "Changes" Group.  
      
7.       Click on "Accept or Reject" from "Changes Group" to tell programme whether you want to keep or permanently delete a change.  
      
Go to the "File Menu" and "Save" all changes that you made in your document.