Wednesday, December 10, 2008

My FTP Server

Now I am the owner of 2GB of space in a free ftp server. I have two accounts viz debdeep777 and debdeep778. And of couse I know the passwords.

The worst thing is ads in the webpages. They cannot modify other file types. But when you upload a html file, they immediately add a lot of crap ads to that. Most of the time the ads are extremely worthless. So, I will use other file types except html in tripod.lycos.co.uk. They provide other servers, but the names are a little objectionable.

I got the musics of Raaz..the mystery continues and they are not so good as I thought.

Tuesday, December 9, 2008

C program for Drawing with characters

This program is designed to draw pictures with various characters. You can use ASCII characters to dwar pictures. 

The main drawback of this program is that it cannot save the picture directly. To save the picture, right click on DOS window and Select All, then Right click again and COPY. Now paste it in a text editor like Notepad and then Save it. Another way is to press the "Print Screen" and to save it in mspaint. 

I think, this program can be used effectively to create beautiful sms messages with colours.

You are welcome to develop this source code and let me know if you can add a SAVE feature to the program.

The numbers 1, 2  and 3 should be replaced by stdio.h, conio.h and dos.h respectively and must be enclosed by angle brackets.

Source code:--


/* Program to draw pictures with characters */
#include1
#include2
#include3
getkey();
status(char ch, int col, int write);
#define UP 72
#define DOWN 80
#define LEFT 75
#define RIGHT 77
#define E 18
#define Q 16
#define U 22
#define D 32
#define C 46
#define N 49
#define L 38
void main()
{
int x, y, i=40, j=25,c, cl=7,key,write=1;
char ch='.',chstor='.';
clrscr();
textcolor(5);
printf("\nCreated and customized by Debdeep Bhattcharya on 17th May, 2008.\n");
getch();
clrscr();
textcolor(4);
cprintf("Welcome to the First program for drawing, created by Debdeep Bhattacharya.");
textcolor(2);
printf("\n\nList of Controlls:--\n");
printf("\nGo right:\tRight\nGo left:\tLeft\nGo up:\t\tUp\nGo down:\tDown");
printf("\nChange character(hold key for ASCII):\tC");
printf("\nColor change(1-14):\tL");
printf("\nPen up:\t\tU\nPen down:\tD\nErase mode:\tE\nDelete all:\tN\nQuit:\t\tQ");
textcolor(6);
cprintf("\n\nHit any key to continue...");
textcolor(cl);   /* Restore default color */
getch();
clrscr();

status(ch,cl,write);
     gotoxy(i,j);

     for(c=0;c<5;c=c)
     {
key=getkey();
switch (key)
{
     case(UP):
     {
j--;
break;
     }
     case(DOWN):
     {
j++;
break;
     }
     case(LEFT):
     {
i--;
break;
     }
     case(RIGHT):
     {
i++;
break;
     }
     case(Q):
     {
gotoxy(68,10);
printf("Hit any  key");
gotoxy(68,11);
printf("to exit...");
goto end;

     }
     case(D):
     {
write=1;             /* write mode is on */
if(ch!=chstor)       /* if erase key was not hit previously */
ch=chstor;   /* To restore the previous character  */
status(ch,cl,write);
gotoxy(i,j);
break;
     }
     case(E):
     {
write=1;
chstor=ch;    /* To keep the previous character  */
ch=' ';
status(ch,cl,write);
gotoxy(i,j);
break;
     }
     case(C):
     {
gotoxy(69,6);
printf("CHAR=?");
ch=getch();
chstor=ch;
status(ch,cl,write);
gotoxy(i,j);
break;
     }
     case(N):
     {
clrscr();
status(ch,cl,write);
break;
     }
     case(L):
     {
gotoxy(69,5);
printf("COLOR=?");
scanf("%d",&cl);
textcolor(cl);
status(ch,cl,write);
gotoxy(i,j);
break;
     }
     case(U):
{
   write=0;       /* turns the write mode off */
   status(ch,cl,write);
   break;
}



     default:
     {
break;
     }

}
if(i<0)
i=-i;
if(j<0)
j=-j;
gotoxy(i,j);
if(write==1)       /* prints the character (writes) only if write mode is on i.e. iff in Pen down mode or pen erase mode */
cprintf("%c",ch);
gotoxy(i,j);     /* To bring the cursor to the character that has been printed. */
   }


   /* This setion of the program is to test the getkey() function */
   /* printf("\nHit a key to get its value...\n");
key=getkey();
printf("\nThe value of the key is: %d",key);
getch();
   */


   end:
    getch();
}
getkey()
{
union REGS i, o;
while(!kbhit())
;
i.h.ah=0;
int86(22, &i, &o);
return(o.h.ah);
}

status(char cha, int col,int write)
{
int c, d;
for(c=68;c<=79;c++)          /* To clear the status box */
{
for(d=1;d<=8;d++)
{
gotoxy(c,d);
printf(" ");
}
}
gotoxy(59,50);
printf("Debdeep Bhattacharya");
gotoxy(68,1);
for(d=1;d<=8;d++)
{
gotoxy(68,d);
printf("|");
}
for(c=68;c<=79;c++)
{
gotoxy(c,8);
printf("--");
}
gotoxy(71,2);
printf("STATUS");
gotoxy(69,4);
if(write==0)
printf("PEN  :UP");
else if(cha==' ')
printf("PEN  :ERASE");
else
printf("PEN  :DOWN");
gotoxy(69,5);
printf("COLOR:%d",col);
gotoxy(69,6);
printf("CHAR :%c",cha);
return 0;
}

How to turn a folder into something else

Hide your folders disguise them to "Recycle Bin" or "Control Panel" or "Network Connections" etc:--


Rename any folder with extension {645FF040-5081-101B-9F08-00AA002F954E}
e.g., if we have a folder "games"
press F2,
then type, "games.{645FF040-5081-101B-9F08-00AA002F954E}"
see the magic....

Restore:--
To get to original form,
remove the extension using
"ren games.{645FF040-5081-101B-9F08-00AA002F954E} games" in dos or as a bat file



There are more such hexadecimal numbers that can be used. You can find them in the key below:--


hkey_current_user> software> Microsoft> Windows> ShellNoRoam> DUIBags> ShellFolders

[** Some keys in this folder may not work. So do ckeck the folders with the new keys.


and you are done.. But the folder can be deleted.

~cheers~  

If you cannot remember the long hexadecimal number, in order to find it out, do the following the fillowing:--

Open regedit and scroll down to the key written below:--

hkey_current_user> software> Microsoft> Windows> Current Version> Explorer> CLSID

There are three keys in the folder. Take the key in the middle of them which starts from {645FFF040...}

There is another key in which you can find more:
HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\DUIBags\ShellFolders

There are a lot of keys but all of them don't work.

How to restore Folder Settings of Windows XP

Locate the Default value under the following key in the registry: HKEY_CLASSES_ROOT\Directory\shell 
Type NONE in the File data box, click OK, and exit the registry editor.

Automatically download torrents using bsnl Night Unlimited

Process to start the computer at specified time and shut it down after the download of a torrent is finished:--

This process can be used to wake up the computer at a specific time, to use the Night Unlimited plan of BSNL broadband to download torrents, to use batch files to connect to the internet directly etc.



  • Add a password to your user account

  • Click Start > Run and type CONTROL USERPASSWORDS2, then press Enter
  • Select your user and Uncheck "Users must enter a username and password to use this computer"
  • Click Apply and give your password.
  • Right Click on Desktop and goto Properties> Screen Saver> Power> Advanced
  • Uncheck "Prompt for password when computer resumes from standby". Also, goto the Hibernate tab and Ckeck "Enable Hibernate".

  • Create a batch file named "connect.bat" (say) that contains the following command:

  • rasdial "connection name" "username" "password"

    [You will get the "connection name" by going to Start> Connect To> Show all connections. The name of the connection you use to connect to the internet should be given in the field "connection name". For my case,it is "Broadband Connection".
    The field "username" should be replaced by the username of the connection name. For may case, it is "debdeep_777".
    The field "password" should be replaced by the password of the connection name.
    Keep the the names enclosed by quotes (") if it contains spaces or special characters. It is safe to give the quotes always.]

  • Click Start> Programs> Accessories> System Tools> Scheduled Tasks
  • Double click on Add Sheduled Task> Next
  • Select Browse> Select the file "connect.bat" that you created earlier> Next> "One time Only"> Next> Set Date and Time> Next> Give password of your user account> Ckeck "Open Advanced tab when I click Finish"> Finish.
  • Goto Settings tab and Ckeck "Wake the computer to run this task" > Ok.

  • Open utorrent and add the desired torrent to the list.
  • Goto Option> Auto Shutdown> "Shutdown when downloads Complete".

  • Hibernate your computer.
  • 15. Remember to keep the power source ON till the time when the computer is desired to be awakened.

    Note: Be sure that the BIOS battery is in good order and Check the date and time settings of your computer.


    The step 1-6 describes how to apply a password to your user account but not to use it while resuming from standby of hibenation.
    The step 7 describes how to connect to the internet using batch file and DOS command and step 8-10 shows how to do it at the system resume. 
    The step 11 is the key to wake up the computer. Note that you need an "excuse" to wake up the computer at a specified time.
    The step 12-13 shows how to utilize the fecility of utorrent to automatically shutdown the computer after the downlaod is finished.