Its basically confusing which gear (setting) to choose. If you choose the usual top-right , then you are on the wrong way. This page has 2 settings button. One on the corner of the page and one just beside the mail navigation keys. The latter is the one you are looking for.
Thursday, December 8, 2011
Change Gmail back to old look
I lost few of my hairs looking for the ' revert to old look temporarily ' button. So I thought this would help people get back their lives (old Gmail).
Saturday, November 12, 2011
Time taken to execute the c program
I was executing a C code which was a loop of 65535. It was basically , a program which was testing the outputs for all possible values and hence can say, testing the algorithm.
I used the gcc compiler to compile the c code. When i executed the code it took a good 5-6 secs to complete the execution. But now we all know the command prompt window could display only a few hundred recent lines . So i decided to print the output to a text document using the
a.exe > sample.txt
command. To my astonishment , the code was executed in less than a sec. All this could only inspire me to check out ' how could i know the clock cycles required to execute the program.
it took some google searches to know that clock() is the function i was looking for which is in the header file time.h .
here is the glimpse of the program.
#include
main()
{
long int i;
clock_t clk;
// write your code here
for (i=0;i<10000;i++)
{
printf("%ld",i);
}
//say your code ends here
clk = clock(); // clock fuction give the clock cycles elapsed since the start of the program
printf("the no of clock cycles required to execute the is %ld",clk );
}
clock_t is long integer type of data type defined in sys/types.h
the function clock() returns a value of type clock_t so we need to declare a variable of this type .
P.S. : the clock cycles taken by the program would differ based on the other processes running on your system. one should keep in mind that , it does not give the time taken by your code to execute if it is the only process running. But it gives the time taken in the current complexity of the processing environment.
Thursday, September 8, 2011
15 min Alarm part3
This is the 'relative time' based reminder. it will play a song every 5 mins , one can always change the time . The time specified is in seconds and cannot exceed 999 secs.
REM File name: Reminder.batREM Description: this is a Batch file that plays a song every 5 mins.REM one can change the time by changing the number of secs which is here as '300' in the CHOICE statement.REM The song can be specified in place of "D:\dwnlds\AIRTEL.wav":againecho offCHOICE /n /C 12 /d 1 /t 300if errorlevel == 1 goto singif errorlevel == 2 goto sing:singstart "C:\Program Files\Windows Media Player\wmplayer.exe" "D:\dwnlds\AIRTEL.wav"
15 min Alarm part2
So , here i am with the code. Rather i have two. I have one which is based in 'absolute times' using the system clock and the other is based on 'relative time'.
This is the code for the 'absolute time' based reminder. Reminds at 10,20,30,40,50 and 00 minutes on the clock.
REM File name: Reminder.batREM Description: this is a Batch file that plays a song every 10 mins.REM The song can be specified in place of "D:\dwnlds\AIRTEL.wav":again@echo offREM Takes the system timeset t=%time%REM t2 = secondsset t2=%t:~6,2%REM t1 = minutesset t1=%t:~3,2%REM One can specify at what minutes do you want a reminderif %t1%==00 goto alarmif %t1%==10 goto alarmif %t1%==20 goto alarm
if %t1%==30 goto alarm
if %t1%==40 goto alarm
if %t1%==50 goto alarmREM provides a delay of 1 sec.CHOICE /n /C 12 /d 1 /t 1clsif errorlevel == 1 goto againif errorlevel == 2 goto again:alarmif %t2%==30 goto singclsgoto again:singREM can provide the link to the desired media player like VLC,etc.REM provide the link to the compatible audio file. start "C:\Program Files\Windows Media Player\wmplayer.exe" "D:\dwnlds\AIRTEL.wav"REM provides a delay of 1 minute.CHOICE /n /C 12 /d 1 /t 60clsif errorlevel == 1 goto againif errorlevel == 2 goto againgoto again
Wednesday, August 24, 2011
15 min Alarm part1
Inspiration:
When i set myself up for surfing on internet, i usually tend to sway away form what i originally intended. Moreover, i exceed the time limit i had decided upon. One of my friends, made a periodic alarm for himself to get more focused on his job. I really don't know weather it is available already or not. But the happiness of running your own code is definitely more satisfying than anything else.
the reason to choose to make a batch file is that
- i wanted it to be in an un-compiled form so that one can adjust it as and when required .
- one can open on a double click.
- it should not be very complicated.
I will put up the code in my next blog..
Subscribe to:
Posts (Atom)