ALT_IMG

You are the cause of my pain

You are the cause of my pain, yet the love I feel for you is my only consolation, my only cure..

ALT_IMG

Saw the girl, whom once I thought as my best friend

Remembering my classmates, after few years, My eyes were filled with tears, Everyone is busy a lot, No one escaped destiny's plot, Saw the girl, whom once I thought as my best friend, Today she is some body else's girl friend, After months remembered about her for a little while, Heard she is happy, that made me smile.

Alt img

It’s been raining since you left me

It’s been raining since you left me, now I’m drowning in the flood. You see, I’ve always been a fighter, but without you I give up.

ALT_IMG

Sweet Heart

Sweetheart.....I miss ......THe whisper of your voice...The warmth of your touch and all the wonderful times that we shared together.......

ALT_IMG

When I see you

When I see you smile and know that it's not for me, that's when I miss you the most.

Saturday, July 9, 2011

BEEPS THE SPEAKER-C SOURCE CODE

0 comments

/*Beeps the speaker using C program*/

#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
int menu(void);

main()
{
while(1)
{
/*get selection and execute the relevant statement*/
switch(menu())
{
case 1:
{
puts("sound the speaker 1\n");
sound(2000);
sleep(2);
nosound();
break;
}
case 2:
{
puts("sound that speaker 2\n");
sound(4000);
sleep(2);
nosound();
break;
}
case 3:
{
puts("You are quitting\n");
exit(0);
break;
}
default:
{
puts("Invalid menu choice\n");
break;
}
}
}
return 0;
}
/*menu function*/
int menu(void)
{
int reply;
/*display menu options*/
puts("Enter 1 for beep 1.\n");
puts("Enter 2 for beep 2.\n");
puts("Enter 3 to quit.\n");
/*scan for user entry*/
scanf("%d", &reply);

return reply;
}
Continue reading →

EMPTY RECYCLE BIN USING C PROGRAM

0 comments

/*Source code of C program--EMPTY RECYCLE BIN*/
#include<stdio.h>

#include<windows.h>
#include<shlobj.h>
#define WIN32_LEAN_AND_MEAN



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
if(MessageBox(NULL, "Press ok to empty the Recycle Bin.", "recycler", MB_YESNO | MB_ICONINFORMATION) != IDYES)
return FALSE;
SHEmptyRecycleBin(NULL, "", 0);
return FALSE ;
}

Continue reading →
Saturday, July 2, 2011

Small C Program-Convert IP address to it's base10 form

0 comments


/*SOURCE CODE OF SIMPLE PROGRAM--CONVERT IP ADRESS TO IT'S BASE10 FORM*/
#include<stdio.h>
#include<getopt.h>

#include<sys/types.h>
#include<locale.h>
#include<regex.h>




#define PACKAGE "ip2b10"
#define VERSION "0.0.2"
#define URL     "WWW"
#define IPEXPR  "([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})"


void print_help(int exval);
void print_version(int exval);


int main(int argc, char *argv[]) {
 regex_t re;
 int opt = 0;
 int print_flag = 0;
 long unsigned int result = 0;
 int var1 = 0, var2 = 0;
 int var3 = 0, var4 = 0;


 /* any options given ? */
 if(argc == 1)
  print_help(1);
 /* option parser */
 while((opt = getopt(argc, argv, "hvxa")) != -1) {
  switch(opt) {
   case 'h': /* print this help and exit */
    print_help(0);
   case 'v': /* print program version and exit */
    print_version(0);
   case 'x': /* output in Hex.. */
    print_flag = 1;
    break;
   case 'a': /* output some additional info... */
    print_flag = 2;
    break;
   case '?': /* no such option */
    fprintf(stderr, "%s: Error - No such option: `%c'\n\n", PACKAGE, optopt);
    print_help(1);
  }
 }


 /* enough options left ? */
 if((argc - optind) == 0)
  print_help(1);
 /* compile regular expression */
 if(regcomp(&re, IPEXPR, REG_EXTENDED) != 0) {
  fprintf(stderr, "%s: Error - compiling regular expression..\n"PACKAGE);
  return 1;
 }
 /* while parsing remaining opts.. */
 for(; optind < argc; optind++) {
  /* very basic test of ip4 dotted quad address format */
  if(regexec(&re, argv[optind], 0, NULL, 0) != 0) {
   fprintf(stderr, "%s: Error - `%s'; not a ip4 dotted quad..\n"PACKAGE, argv   [optind]);  
   continue;
  }
  /* read address */
  scanf(argv[optind], "%d.%d.%d.%d", &var1, &var2, &var3, &var4);
  /* convert address to base 10 */
  result = (var1 << 24) + (var2 << 16) + (var3 << 8) + var4;
  /* output the results */
  if(print_flag == 0)
   printf("%lu\n", result);
  else if(print_flag == 1)
   printf("%0lx\n", result);
  else {
   printf("%%\n");
   printf("ip addr : %s\n", argv[optind]);
   printf("formula : %d * (256^3) + %d * (256^2) + %d * 256 + %d\n"
     var1, var2, var3, var4);
   printf("base10  : %lu\n", result);
   printf("hex     : %0lx\n", result);
  }
 }
 return 0;
}
void print_help(int exval) {
 printf("%s,%s convert an IP address to its base10 form\n", PACKAGE, VERSION);
 printf("Usage: %s [-h] [-v] [-x] [-a] IP IP..\n\n", PACKAGE);


 printf(" -h        print this help and exit\n");
 printf(" -v        print version and exit\n");
 printf(" -x        print address in Hexadecimal\n");
 printf(" -a        print additional info\n\n");


 printf(" Please note, this is valid for IP version 4 addresses only!\n");
 exit(exval);
}
/* print version and exit with exval */
void print_version(int exval) {
 exit(exval);
}


Continue reading →