Sunday, November 22, 2009

How to make you PC Dual Boot Linux and windows




For past few years I have been using Linux (Fedora). When I decided to use Linux the first thing came in my mind is how to make my PC dual boot for both windows and Linux. Though one method was simple I allowed the grub loader to install in my MBR (master boot record) and there I chose  lable "other" as default.

Though that was the most simple thing to do but later I faced a problem. When I tried to boot my pc with windows xp bootable CD it did't booted with that. That was because there was grub loader in MBR.

So later I searched for Installing Fedora or other Linux without installing GRUB in MBR. So by default the windows loader NTLDR should detect the linux partion and it should boot your linux with it. The the problem is that you NTLDR can't detect linux partion. So basically you have to copy a file in your windows partion.

There are few methods to do it :-
  • 1# Use dd to copy GRUB stage1 to a binary file:- Install Fedora and choose the boot loader option to install GRUB in the first sector of the Fedora boot partition (see attachment). Fedora will not boot at first. In linux rescue (see attachment), use the dd command to copy GRUB stage1 located in the first sector of the Fedora boot partition to a binary file in the Windows root directory. Then manually edit boot.ini (see attachment) to add a new entry for Fedora to the Windows boot menu to launch the binary file. 
    • After Fedora is installed...
    • Boot with the Fedora DVD into linux rescue.
    • At the command prompt, enter:

      dd if=/dev/sdxy of=fedora.bin bs=512 count=1


    • NOTE: You change x & y to the drive & partition of the Fedora boot partition with stage1. You may also change the name of the output file to whatever you choose.

    • Copy the binary file to a floppy or a partition that Windows can access (see attachment).
    • Exit linux rescue and reboot into Windows.
    • Copy the binary file to C:\ where boot.ini is also located.
    • Edit boot.ini to add a line similar to this:

      Code:
      c:\fedora.bin="Fedora"


    • Reboot.
    • How it looks on paper

      Code:
                                                boot.ini               /--> kernel
                                                          |                 / 
      BIOS --> Partition Loader --> Boot Sector Code --> ntldr --> XP Menu -----> kernel          grub.conf                  /--> kernel
                 (Master Boot        (Volume Boot          |                \                         |                     / 
                    Record)             Record)       ntdetect.com           \--> fedora.bin --> GRUB stage2 --> GRUB Menu -----> kernel
                                                                                 (GRUB stage1)   (/boot/grub)               \ 
                                                                  
       

    • NOTE: This "dd method" sometimes doesn't work if the Fedora boot partition is not on the same drive as Windows. That can result in an incorrect boot drive number being specified in the code of the binary file at offset 40h. The hex values for the boot drive number are first=80h, second=81h, third=82h, and so on. If the value at offset 40h is FFh, that means that the stage1 program gets the boot drive number from BIOS, and that also could be wrong for the physical layout. The binary file can be edited with any hex editor to change the boot drive number when this happens. In the example below, the value for the boot drive number at offset 40h is FFh. The Fedora boot partition was on the second drive, and the binary file did not work to boot the Fedora system. The binary file was edited with ghex to change the boot drive number to 81h, and then it worked to boot the Fedora system.

  •  2# BOOTPART:-
    • Summary

      Install Fedora and choose the boot loader option to install GRUB in the first sector of the Fedora boot partition (see attachment). Fedora will not boot at first. Use BOOTPART in Windows to create a binary file containing code that loads and executes the boot sector code of the Fedora boot partition (stage1). BOOTPART also edits boot.ini to add a new entry for Fedora to the Windows boot menu to launch the binary file. BOOTPART is often useful when the dd-created binary file fails to work.

      The Steps

      After Fedora is installed...
    • Reboot into Windows.
    • Download BOOTPART from the Internet and unzip the files to your Windows Desktop.
    • Open a Windows Command Prompt window. From here on, everything occurs in this window.
    • Change directories to the Windows Desktop...

      Code:
      cd desktop


    • Enter the command bootpart without any options and your partitions will be listed. Example...

      Code:
      C:\Documents and Settings\User\Desktop>bootpart
      
      Physical number of disk 0 : 9590e5ce
       0 : C:* type=b  (Win95 Fat32), size= 2008093 KB, Lba Pos=63
       1 : C:  type=5  (Extended), size= 18000832 KB, Lba Pos=4016250
       2 : C:  type=7  (HPFS/NTFS), size= 18000801 KB, Lba Pos=4016313
      Physical number of disk 1 : b4f03683
       3 : D:* type=7  (HPFS/NTFS), size= 80035798 KB, Lba Pos=63
      Physical number of disk 2 : 9a109a0
       4 : E:* type=83 (Linux native), size= 104391 KB, Lba Pos=63
       5 : E:  type=8e (Linux LVM), size= 38989755 KB, Lba Pos=208845


    • Now enter the command again in this format...

      Code:
      bootpart [partition number] [filename] [title]
      [partition number] Get this from the output of your bootpart command without options in the previous step. In the above example, partition #4 is the Fedora boot partition and is easy to spot since it is listed as type=83 (Linux native) and the other Linux partition is an LVM physical volume. If there had been several type 83 partitions instead of the LVM PV, here are some clues to find the boot partition: a) it is usually the first type 83 Linux partition in the list, b) it is usually about 100000 KB in size, c) it may have an asterisk (*) by it indicating it is the active partition.

      [filename] This is the name to give the binary file to be created in the Windows root directory. It can be anything you want.

      [title] This the title of the Fedora OS in the Windows boot loader menu. It can be anything you want.



    • Continuing with the example from above, the command could be like this...

      Code:
      bootpart 4 C:\fedora.bin "Fedora"


    • Reboot.
How it looks on paper
Code:
boot.ini               /--> kernel
                                                    |                 / 
BIOS --> Partition Loader --> Boot Sector Code --> ntldr --> XP Menu -----> kernel                          grub.conf                  /--> kernel
           (Master Boot        (Volume Boot          |                \                                         |                     / 
              Record)             Record)       ntdetect.com           \--> fedora.bin --> GRUB stage1 --> GRUB stage2 --> GRUB Menu -----> kernel
                                                                            (BOOTPART)    (boot sector)    (/boot/grub)               \                                                     
  •  #3: GRUB for DOS(my favorate)
    Summary

    Install Fedora and choose the boot loader option to install GRUB in the first sector of the Fedora boot partition (see attachment). Fedora will not boot at first. This method uses GRUB for DOS (aka GRUB4DOS) which is capable of launching the Fedora kernel directly without using any GNU GRUB stages. Even though Fedora's GRUB stages are not required for this method to work, there is still a benefit from choosing to install GRUB in the first sector of the Fedora boot partition. It causes a grub.conf file to be created for Fedora while still sparing the master boot record from changes. Having a grub.conf file is useful for copying menu commands to the GRUB for DOS menu.lst or for using the configfile menu command to launch Fedora. The stage1 code that is installed in the boot sector causes no harm sitting there unused.

    The Steps

    After Fedora is installed...
  • Reboot into Windows.
  • Download the GRUB4DOS zip file.
  • Unzip the file and copy these files to C:\ (or the Windows root directory):



    1. grldr
    2. menu.lst



  • Edit boot.ini (see attachment) to add a line similar to this:

    Code:
    c:\grldr="Start GRUB"


  • Edit menu.lst to add sections for the Linux systems (and to tidy up for the many examples).
  • Reboot.
How it looks on paper
Code:
boot.ini               /--> kernel
                                                    |                 /
BIOS --> Partition Loader --> Boot Sector Code --> ntldr --> XP Menu -----> kernel                /--> kernel
           (Master Boot        (Volume Boot          |                \                          /
              Record)             Record)       ntdetect.com           \--> grldr --> GRUB Menu -----> kernel
                                                                              |                  \
                                                                           menu.lst               \--> kernel
                                                                      (using configfile)
The usual menu commands all work in the GRUB for DOS menu.lst file. The title, root, kernel, and initrd lines can be copied from another configuration file to directly boot a Linux kernel. Or, the configfile command can be used to reload the menu with the information from another system's GRUB configuration file. And, the chainloader command can be used to launch boot sector code.

Wednesday, November 4, 2009

Star Field Effect in C by writing in VGA memory

For past few time I was working on the 16 Bit version of C compiler namely TurboC++. and was programing in few Graphical libraries. I was keen on writing a program in C to show a similar effect like that of Star field effect in the Windows Screen Saver but writing the routes at low level directly to VGA memory. I designed a library for that form a bit of help form net.
                                  Here I am posting a C program to Create a Star field effect in C.  Also I have well Documented the code so that you can under Stand it well.

download the executable  and source code file form exe form here

Library to enable mouse in 16BIT turboC++ (works upto windows XP)

///////////////////////////////////////////////////////////////
///            MOUSE.H WRITTEN BY RITESH RANJAN        
///            
///         ******************************************    
///            feel free to modify and use it   I would to hear from u abt improvements       
///      ************************************************   
///           ritesh_ranjan007@yahoo.com                 
//////////////////////////////////////////////////////////////////

#include< dos.h >

unsigned int mousex,mousey,mouseb;   // global varialble


void showmouse();
void hidemouse();
void readmouse();
void setmousexy();
void setminmaxx(int ,int);
void setminmaxy(int, int);





//////////////////////////////////////////////////////

void showmouse()
{
   _AX=0x1;
   geninterrupt(0x33);
}
///////////////////////////////////////////////////////
void hidemouse()
{
   _AX=0x2;
   geninterrupt(0x33);
}
//////////////////////////////////////////////////////
void readmouse()
{
  _AX=0x3;
  geninterrupt(0x33);
  mouseb=_BX;
  mousex=_CX;
  mousey=_DX;
}

///////////////// move mouse to x,y /////////////////////
void setmousexy(int x,int y)
{
  _AX=0x4;
  _CX=x;
  _DX=y;
  geninterrupt(0x33);
}
/////////////////// set max min x values /////////////////////////////

void setminmaxx(unsigned int min,unsigned int max)
{
  _AX=0x7;
  _CX=min;
  _DX=max;
  geninterrupt(0x33);
}

////////////////////// set max min y values /////////////////////////

void setminmaxy(unsigned int min,unsigned int max)
{
  _AX=0x8;
  _CX=min;
  _DX=max;
  geninterrupt(0x33);
}
/////////////////////////////////////////////////////////////////

Tuesday, November 3, 2009

Image Processing - Code to filter color in MATLAB

In this post we will learn to how filter color in Matlab. Matlab provide very good Image processing tool box with many ready made functions. Here I have illustrated a very basic method to filter color in Matlab. The concept is- in the 3D matrix of RGB color space, if the value at a particular pixel have more value in Red space than blue or Green, and if it is within a tolerance value then consider that pixel Red.
eg -


  elseif im(i,j,1)>200 & im(i,j,2)<50 & im(i,j,3)<50
            white(i,j)=0;
            green(i,j)=0;
            blue(i,j)=0;
            red(i,j)=1;


Copy this code an save as .m file. then run this file.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------@author:-  RITESH RANJAN
% -------- visit:-  http://programing-tutorial.blogspot.com/
% ------I have used a simple method. There are many more complex
%--------------- methods too that I will discuss Later
% ------------Just copy it save a .m file run in MATLAB 7 or higher
% ----------------Don't forget to change the name of Image file

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear;
im=imread('image.jpg'); %put image name here
imtool(im);
sz=size(im);

for i=1:sz(1)
    for j=1:sz(2)
        if im(i,j,1)>200 & im(i,j,2)>200 & im(i,j,3)>200
            white(i,j)=1;
            green(i,j)=0;
            blue(i,j)=0;
            red(i,j)=0;
        elseif im(i,j,1)>200 & im(i,j,2)<50 & im(i,j,3)<50
            white(i,j)=0;
            green(i,j)=0;
            blue(i,j)=0;
            red(i,j)=1;
        elseif im(i,j,1)<50 & im(i,j,2)>200 & im(i,j,3)<50
            white(i,j)=0;
            green(i,j)=1;
            blue(i,j)=0;
            red(i,j)=0;
        elseif im(i,j,1)<50 & im(i,j,2)<50 & im(i,j,3)>200
            white(i,j)=0;
            green(i,j)=0;
            blue(i,j)=1;
            red(i,j)=0;
        else 
            white(i,j)=0;
            green(i,j)=0;
            blue(i,j)=0;
            red(i,j)=0;
       end
             end
end


imtool(white);
imtool(green);
imtool(blue);
imtool(red);

Image Proseesing - Extacting Shapes using OpenCV

 // This is a program to find SQUARE shape and Circle shape


#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include < math.h >
int main(int argc, char* argv[])
{

    IplImage* img=0;
    IplImage* gray=0;

    CvMemStorage* storage = cvCreateMemStorage(0);
    CvSeq*  contours;

    img=cvLoadImage("shape.jpg");

    if(img==NULL)
    {
        printf("Error in opening image\n");
        return -1;
    }


    cvNamedWindow("win1",1);
    cvNamedWindow("win2",1);

    gray = cvCreateImage( cvSize(img->width, img->height), IPL_DEPTH_8U, 1 );
    cvCvtColor(img,gray,CV_BGR2GRAY );

    uchar *data;
    data=(uchar* )img->imageData;

    uchar *data_gray;
    data_gray=(uchar* )gray->imageData;

    int  step_g=gray->widthStep;
    int  step=img->widthStep;
    int channels=img->nChannels;

   


     for(int i=0;iheight;i=i++)
     {
         for(int j=0;jwidth;j++)
         {
             
             
             /////////////exracting  white
             if( (data[i*step+j*channels+0]>200) && (data[i*step+j*channels+1]>200) && (data[i*step+j*channels+2]>220) )
                 data_gray[i*step_g+j] = 255;


            else
                data_gray[i*step_g+j] = 0;

         }
         
     }

   // find counters in the gray image - object detection
    cvFindContours( gray, storage, &contours, sizeof(CvContour),
                    CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE , cvPoint(0,0) );

   

    double area;
    double p;
    double metric_s,metric_c;

// loop through all counturs   

for( ; contours != 0; contours = contours->h_next )
    {
        area=fabs( cvContourArea(contours,CV_WHOLE_SEQ ) );
        p=fabs( cvArcLength( contours, CV_WHOLE_SEQ, -1) );

        // determine metric for circle
        metric_c=area*4*3.14/(p*p);
        metric_s=area*16/(p*p);

        if(metric_c > 0.75f && metric_s > 1.0f)
            printf(" circle \n");

        else if(metric_s > 0.9f && metric_c < 0.8f )
            printf(" square \n");

        else
            printf(" nothing ");


        printf("area = %lf perimeter=%lf metric_c=%lf metric_s=%lf\n",p,area,metric_c,metric_s);



    }


     cvShowImage("win1",img);
     cvShowImage("win2",gray);

     cvWaitKey(0);
   
    cvDestroyWindow("win1");
    cvDestroyWindow("win2");

    cvReleaseImage(&img);
    cvReleaseImage(&gray);
   
   
   
   
    //printf("Hello World!\n");
    return 0;
}

Sunday, November 1, 2009

Anti virus for free

There are so many people on the net trying to find a final solution to the biggest problem on earth for Window user -- VIRUS. The solution lies in installing a antivirus because of course windows is too lame to protect it self.


Now the biggest problem is which is the best anti-virus.According to the PCWorld the Kaspersky anti-virus stood third on the list of best anti virus. So without wasting any time lets see how we can install Kaspersky anti-virus for free. The biggest problem with the hacked version or craked version is you cannot Update your anti virus .

But using this trick you can not only have a free anti virus but also you can update it and protect your computer.For this we will use KASPERSKY -> Kaspersky 6.0.1.411 becoz it works only in this version. So you will have to down load it form http://kaspersky-antivirus.brothersoft.com/kaspersky-antivirus6.0.1.411


1- go To ( Start ) then ( Run )

2- Type ( regedit ) and press ( OK )

3- Go To ( HKEY_LOCAL_MACHINE\SOFTWARE\KasperskyLab\AVP6\Data ) & Right Click On ( Data ) & Choose ( Permissions )

4- Choose ( Advanced ) From The ( Permissions For Data ) New Window Opened

5- In ( Advanced Security Settings for Data ) Window .. There is a sentence which begin with ( Inherit from parent ... ) click on the nike or check mark to remove it

6- After Removing the check or nike mark you will get a new message .. choose from it ( Remove )

7- Then in ( Advanced Security Settings for Data ) click on ( Apply )

8- After Clicking Apply you will get a new message choose ( Yes )

9- After That Press ( OK ) In ( Advanced Security Settings for Data )

10- After That .. Press ( OK ) In ( Permissions For Data )

11- After That Make An ( Exit ) For ( KasperSky ) .. & Run It Again

12- You Will Notice That The Kaspersky Icon Is Not ( RED ) But Its ( GRAY ) Which means that the program is not activated

13- But if you opened it you will see all things are working perfect 100% Working.

What Happened To The Program After These Steps ?

- You Will update the kaspersky database manually ... no automatic updates.

- The windows security center will tell you that the firewall or\and antivirus is not working ... becoz you made the kaspersky seemed unactiviated. Actually the registry key you have edited stores the information about activation keys and all that. You actually not delected the key but you have prevented the kaspersky form reading it by denying permissions.

Note:- To uninstall you have to undo the steps above. To have to grand all permision to the key above. Also After installing you have to update the Kaspersky before you continue. Because Kaspersky 6 is petty old an you must have a updated version for complete virus protection.

Play Video in Ms Paint, Photoshop, and in MSWord

Yes you can really Play video in Ms paint. But that doesn't mean that MsPaint have a built in player.

This is just a trick that can be played by using VLC. First you have to enable wallpaper mode in VLC .

Just follow these steps  http://programing-tutorial.blogspot.com/2009/10/set-any-video-as-your-desktop-wallpaper.html

Now what you have to do is to press "Print SysRq" to print System Screen.

Now open MsPaint , select new file and press crt+v to paste the clipboard content in msPaint.

---- Now you will see a video playing in the paint.

---DO the same for PHOTOSHOP , select a new file and take a PrintScreen and press crt+v.
-- The same applies for MSWord too. Even where ever you can paste a picture you will see video running.

:) njoy

Friday, October 30, 2009

Linking and configuring OpenCV with Visual C++ .Net

In my eailer posts I have written how to Link Opencv Library in VC++ visula studio 6 and in Bloodshed's DEVC++. Now we will learn how to Link and configue OpenCV with Visual C++ .Net.

Linking DLLs:

•    To permanantly include necessary dll files, add "C:\Program Files\OpenCV\bin" to PATH by visiting Advanced tab in System of Windows (the locate of directory might be different).
•    One can just copy necessary dll files into project directory with source files.

Customize Global Options:
•    Open the Visual C++ .Net Application. In the menu bar, select Tools->Options
•    In the listing, choose Projects->VC++ Directories.
•    First, select Library files from the "Show Directories for" List Box.
•    Click the Insert New icon, and locate the folder where you have installed opencv.
•    Consider that it is installed in "C:/Program Files/OpenCV".
•    In the Library files list, locate and add:
"C:\Program Files\OpenCV\lib"


•    Now choose Include files in the list box, and locate and add the following directories:
        "C:\Program Files\OpenCV\cv\include"
        "C:\Program Files\OpenCV\cxcore\include"
        "C:\Program Files\OpenCV\otherlibs\highgui"
        "C:\Program Files\OpenCV\cvaux\include"
        "C:\Program Files\OpenCV\otherlibs\_graphics\include



  • Next, choose source files in the list box, and locate and add the following directories:
        "C:\Program Files\OpenCV\cv\src"
        "C:\Program Files\OpenCV\cxcore\src"
        "C:\Program Files\OpenCV\cvaux\src"
        "C:\Program Files\OpenCV\otherlibs\highgui"
        "C:\Program Files\OpenCV\otherlibs\_graphics\src"

Now click OK in the Options dialog.
•    You have successfully configured the global settings.
Create New Project:
•    Within Developer Studio create new application:
•    Select from menu "File"->"New..."->"Projects" tab.
•    Choose "Win32 Application" or "Win32 console application" - the latter is the easier variant and both the sample projects have this type.



Type the project name and choose location
•    Click Ok.. In the Application Wizard, Just click Finish. 

Nokia Codes Tips and Tricks

IMEI number: * # 0 6 #
Software version: * # 0 0 0 0 # or * # 9 9 9 9 # or * # 3 1 1 0 #
Simlock info: * # 9 2 7 0 2 6 8 9 #
NOKIA 3330
*#06#
This will show your warranty details *#92702689#
*3370#
Basically increases the quality of calling sound, but decreases battery length.
#3370#
Deactivates the above
*#0000#
Shows your software version
*#746025625# This shows if your phone will allow sim clock stoppage
*4370#
Half Rate Codec activation. It will automatically restart
#4370#
Half Rate Codec deactivation. It will automatically restart
Restore Factory Settings
To do this simply use this code *#7780#
Manufacturer Info
Date of Manufacturing *#3283#
*3001#12345# (TDMA phones only)

press and hold # Lets you switch between lines

NOKIA5110/5120/ 5130/5190


IMEI number: * # 0 6 #
Software version: * # 0 0 0 0 #
Simlock info: * # 9 2 7 0 2 6 8 9 #
Enhanced Full Rate: * 3 3 7 0 # [ # 3 3 7 0 # off]
Half Rate: * 4 7 2 0 #
Provider lock status: #pw+1234567890+ 1
Network lock status #pw+1234567890+ 2
Provider lock status: #pw+1234567890+ 3
SimCard lock status: #pw+1234567890+ 4
NOKIA 6110/6120/6130/ 6150/6190
IMEI number: * # 0 6 #
Software version: * # 0 0 0 0 #
Simlock info: * # 9 2 7 0 2 6 8 9 #
Enhanced Full Rate: * 3 3 7 0 # [ # 3 3 7 0 # off]

(11) #pw+1234567890+ 4# SIM Card Lock Status. (use the "*" button to obtain the "p,w" Go to Top
and "+" symbols).

(12) *#147# (vodafone) this lets you know who called you last.

(13) *#1471# Last call (Only vodofone).

(14) *#21# Allows you to check the number that "All Calls" are diverted to

(15) *#2640# Displays security code in use.

(16) *#30# Lets you see the private number.

(17) *#43# Allows you to check the "Call Waiting" status of your phone.

(18) *#61# Allows you to check the number that "On No Reply" calls are diverted to.

(19) *#62# Allows you to check the number that "Divert If Unreachable (no service)" calls
are diverted to.

(20) *#67# Allows you to check the number that "On Busy Calls" are diverted to.

(21) *#67705646# Removes operator logo on 3310 & 3330.

Few more codes

(3) *#4720# Activate Half Rate Codec - Your phone uses a lower quality sound but you should gain approx 30%

more Talk Time.

(4) *#4720# Deactivate Half Rate Codec.

(5) *#0000# Displays your phones software version, 1st Line : Software Version, 2nd Line : Software Release

Date, 3rd Line : Compression Type.

(6) *#9999# Phones software version if *#0000# does not work.

(7) *#06# For checking the International Mobile Equipment Identity (IMEI Number).

(8) #pw+1234567890+ 1# Provider Lock Status. (use the "*" button to obtain the "p,w"
and "+" symbols).

(9) #pw+1234567890+ 2# Network Lock Status. (use the "*" button to obtain the "p,w"
and "+" symbols).

(10) #pw+1234567890+ 3# Country Lock Status. (use the "*" button to obtain the "p,w"
and "+" symbols).


This will put your phone into programming mode, and you'll be presented with the programming menu.
2) Select "NAM1"
3) Select "PSID/RSID"
4) Select "P/RSID 1"
Note: Any of the P/RSIDs will work
5) Select "System Type" and set it to Private
6) Select "PSID/RSID" and set it to 1
7) Select "Connected System ID"
Note: Enter your System ID for Cantel, which is 16401 or 16423. If you don't know yours,
ask your local dealer for it.
8) Select "Alpha Tag"
9) Enter a new tag, then press OK
10) Select "Operator Code (SOC)" and set it to 2050
11) Select "Country Code" and set it to 302 for Canada, and 310 for the US.
12) Power down the phone and power it back on again
ISDN Code
To check the ISDN number on your Nokia use this code *#92772689

Set any video as your desktop wallpaper.

This is a pretty simple trickk using which you can set any video as your desktop wallpaper.

Just follow the steps given below:

1.Download VLC Media Player and install it.
http://www.videolan.org/vlc/download-windows.html

2.Run VLC media player,go to Settings->preferences->Interface->Main interfaces,then click on wxWidgets.Remove the tick on "Taskbar" and put a tick on "Systray icon".

FOR Version 9.6+ of VLC -  ,go to Tools->Preferences->Video,then put a tick on "Enable wallpaper mode ".

3.Now go to Video->Output Modules->DirectX.On the bottom right put a tick on advanced options check box.You will now see some options.Put a tick on "Enable Wallpaper Mode ".

FOR Version 9.6+ of VLC :- Just go to Video and check "DirectX Wallpaper".


4.Now,select playlist and put a check or tick on "Repeat current item ".
FOR Version 9.6+ of VLC :- You don't need this step.

5.Press the Save button.Now close the VLC player and run it again(to save the settings permanently).

6.Now play any video you would like to set as Wallpaper.Right click on the video and click on "Wallpaper".The video would be set as your wallpaper!!!!
FOR Version 9.6+ of VLC:-  check "DirectX Wallpaper".


Since you have checked the option "repeat current item ",the selected video will play on continuously.It will start again when finished.VLC player will remain in your system tray.If you wish to remove the wallpaper simply close the player and you will get back your original wallpaper.

Microsoft Windows Run command

On the Microsoft Windows operating system, the Run command is used to directly open an application or document whose path is known. It functions more or less like a single-line command line interface.

Starting with Windows 95, the Run command is accessible through the Start menu and also through the shortcut key. (Windows key + R).

Although the Run command is still present in Windows Vista, it no longer appears directly on the Start menu by default, in favor of the new search box and a shortcut to the Run command in the Accessories sub-menu.

 Here is the list of run commands :-


# Accessibility Controls - access.cpl
# Accessibility Wizard - accwiz
# Add Hardware Wizard - hdwwiz.cpl
# Add/Remove Programs - appwiz.cpl
# Administrative Tools - control admintools
# Automatic Updates - wuaucpl.cpl
# Bluetooth Transfer Wizard - fsquirt
# Calculator - calc
# Certificate Manager - certmgr.msc
# Character Map - charmap
# Check Disk Utility - chkdsk
# Clipboard Viewer - clipbrd
# Command Prompt - cmd
# Component Services - dcomcnfg
# Computer Management - compmgmt.msc
# Control Panel - control
# Date and Time Properties - timedate.cpl
# DDE Shares - ddeshare
# Device Manager - devmgmt.msc
# Direct X Troubleshooter - dxdiag
# Disk Cleanup Utility - cleanmgr
# Disk Defragment - dfrg.msc
# Disk Management - diskmgmt.msc
# Disk Partition Manager - diskpart
# Display Properties - control desktop
# Display Properties - desk.cpl
# Dr. Watson System Troubleshooting Utility - drwtsn32
# Driver Verifier Utility - verifier
# Event Viewer - eventvwr.msc
# Files and Settings Transfer Tool - migwiz
# File Signature Verification Tool - sigverif
# Findfast - findfast.cpl
# Firefox - firefox
# Folders Properties - control folders
# Fonts - control fonts
# Fonts Folder - fonts
# Free Cell Card Game - freecell
# Game Controllers - joy.cpl
# Group Policy Editor (for xp professional) - gpedit.msc
# Hearts Card Game - mshearts
# Help and Support - helpctr
# HyperTerminal - hypertrm
# Iexpress Wizard - iexpress
# Indexing Service - ciadv.msc
# Internet Connection Wizard - icwconn1
# Internet Explorer - iexplore
# Internet Properties - inetcpl.cpl
# Keyboard Properties - control keyboard
# Local Security Settings - secpol.msc
# Local Users and Groups - lusrmgr.msc
# Logs You Out Of Windows - logoff
# Malicious Software Removal Tool - mrt
# Microsoft Chat - winchat
# Microsoft Movie Maker - moviemk
# Microsoft Paint - mspaint
# Microsoft Syncronization Tool - mobsync
# Minesweeper Game - winmine
# Mouse Properties - control mouse
# Mouse Properties - main.cpl
# Netmeeting - conf
# Network Connections - control netconnections
# Network Connections - ncpa.cpl
# Network Setup Wizard - netsetup.cpl
# Notepad notepad
# Object Packager - packager
# ODBC Data Source Administrator - odbccp32.cpl
# On Screen Keyboard - osk
# Outlook Express - msimn
# Paint - pbrush
# Password Properties - password.cpl
# Performance Monitor - perfmon.msc
# Performance Monitor - perfmon
# Phone and Modem Options - telephon.cpl
# Phone Dialer - dialer
# Pinball Game - pinball
# Power Configuration - powercfg.cpl
# Printers and Faxes - control printers
# Printers Folder - printers
# Regional Settings - intl.cpl
# Registry Editor - regedit
# Registry Editor - regedit32
# Remote Access Phonebook - rasphone
# Remote Desktop - mstsc
# Removable Storage - ntmsmgr.msc
# Removable Storage Operator Requests - ntmsoprq.msc
# Resultant Set of Policy (for xp professional) - rsop.msc
# Scanners and Cameras - sticpl.cpl
# Scheduled Tasks - control schedtasks
# Security Center - wscui.cpl
# Services - services.msc

# Shared Folders - fsmgmt.msc
# Shuts Down Windows - shutdown
# Sounds and Audio - mmsys.cpl
# Spider Solitare Card Game - spider
# SQL Client Configuration - cliconfg
# System Configuration Editor - sysedit
# System Configuration Utility - msconfig
# System Information - msinfo32
# System Properties - sysdm.cpl
# Task Manager - taskmgr
# TCP Tester - tcptest
# Telnet Client - telnet
# User Account Management - nusrmgr.cpl
# Utility Manager - utilman
# Windows Address Book - wab
# Windows Address Book Import Utility - wabmig
# Windows Explorer - explorer
# Windows Firewall - firewall.cpl
# Windows Magnifier - magnify
# Windows Management Infrastructure - wmimgmt.msc
# Windows Media Player - wmplayer
# Windows Messenger - msmsgs
# Windows System Security Tool - syskey
# Windows Update Launches - wupdmgr
# Windows Version - winver
# Windows XP Tour Wizard - tourstart
# Wordpad - write

Windows DOS commands VS unix commands

Hi all this is a comparison of DOs commands VS unix commands. As contary to Unix commands Doc commands are not that much famous. But this table will help you to compare the commands and to use them.

DOS Command
UNIX or Bash Command
Action
DIR
ls -l (or use ls -lF)(-a all files)
(df -k Space remaining on filesystem)
List directory contents
DIR *.* /o-d
DIR *.* /v /os
DIR /s
DIR /aa
ls -tr
ls -ls
ls -R
ls -a
List directory contents by reverse time of modification/creation.
List files and size
List directory/sub-directory contents recursively.
List hidden files.
TREE
ls -R
List directory recursivly
CD
cd
Change directory
MKDIR
MD
mkdir
Make a new directory
ASSIGN
ln
Create a file or directory link
RMDIR
RD

rmdir
Remove a directory
CHDIR
pwd
Display directory location
DEL
ERASE
rm -iv
Remove a file
RMDIR /S (NT)
DELTREE (Win 95...)
rm -R
Remove all directories and files below given directory
COPY
cp -piv
Copy a file
XCOPY
cp -R
Copy all file of directory recursivly
RENAME or MOVE
mv -iv
Rename/move a file
TYPE
cat
Dump contents of a file to users screen
MORE
more
Pipe output a single page at a time
HELP or COMMAND /?
man
Online manuals
CLS
clear
ctrl-l
Clear screen
EXIT
EXIT0
exit
exit 0
Exit a shell
FIND
FINDSTR
grep
Look for a word in files given in command line
COMP
diff
Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff.
FC
diff
Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff.
SET
set and env
List all environment variables
SET variable=value
echo %variable%
set
export variable=value
echo $variable
Set environment variables
Show environment variables
ECHO text
echo text
Echo text to screen
SET variable
setenv (for C shell) or export VAR=val (for Korn shell. Also VAR=val)
Set environment variables
PATH
PATH %PATH%;C:\DIR
echo $PATH
PATH=$PATH:/dir
Display search path for executables.
Set PATH environment variable.
PROMPT $p$g
export PS1='\h(\u)\W> '
Set user command prompt.
DATE or TIME
date
Show date. (also set date - DOS only)
DOSKEY /h
history
List command history
DOSKEY NAME=command
alias NAME=command
Set command alias
BREAK ON
trap
Trap ctrl-break / Trap signals.
SORT
sort
Sort data alphabetically/numerically
EDLIN
ed
Line mode editor
EDIT filename.txt
pico, gnp, vi, xedit, xemacs,dtpad
Edit a file. The Linux editor which looks most like DOS edit is probably Pico. (Not a recomendation!)
BACKUP files A:\
tar -cvf /dev/fd0 files
mdir, mcopy
doswrite -a file (AIX only)
Save files to floppy.
See Using DOS floppies
RESTORE A:\ files
tar -xvf /dev/fd0 files
mdir, mcopy
dosread -a file (AIX only)
Read files from floppy.
See Using DOS floppies
ATTRIB [+r|-r] [+a|-a] [+s|-s] [path\file] /s
chmod
Change file permissions. DOS: +:set to -:remove r:Read only a:Archive s:System /s:recursively
ATTRIB +h or -h
mv file .file
Change file to a hidden file - rename file with prefix "."
PRINT
lpr
Print a file
CALL
COMMAND /C (DOS), CMD (NT)
source script (cshrc)
. script (bash)
sh script
Execute script from within batch shell.
MEM
free
top
Show free memory on system
TASKLIST (WIN2K, XP)
ps -aux
top
List executable name, process ID number and memory usage of active processes
MSD
lsdev
Show system info (Command borrowed from AIX)
SCANDISK
DEFRAG C:
fsck
debugfs
Check and repair hard drive file system
CHDISK
du -s
Disk usage.
FDISK
fdisk
Tool to partition a hard drive.
SUBST V: C:\directory\path
mount
Mount a drive letter to a folder/directory on your hard drive.
FORMAT
mke2fs
See: fdformat and mformat for floppies
Format drive file system.
VER
uname -a
echo $SHELL
cat /etc/issue
Operating system/shell version
pkzip
tar and zip
Compress and uncompress files/directories. Use tar to create compilation of a directory before compressing. Linux also has compress, gzip
HOSTNAME
hostname
Print host name of computer
PING
ping
Send packets to a network host
TRACERT
traceroute
Show routes and router hops to given network destination.
IPCONFIG (NT)
WINIPCFG (Win 95...)
ifconfig
Display/configure network interface
NBTSTAT (Netbios info: -n, -c)
NBTSTAT -a host-name
NBTSTAT -A IP-address
nslookup host-name
host host-name
Print DNS info for host.
ROUTE PRINT
route -n
Print routing table.
NET HELP START
chkconfig --list |grep on
List services.
NET STARTservice-name
NET STOPservice-name
service service-name start
service service-name stop
Start/stop service/daemon.
NET SHARES
df
Show mounted shares/filesystems.
NET SEND (NT)
smbclient -M MS-Windows-host-name
talk
Send pop-up to a MS/Windows PC
Send message to another Unix/Linux user. See YoLinux tutorial
WIN
startx
Start X-Windows.
REBOOT
shutdown -r now
Reboot system.

Open CV Tutorial sample program and Linking Opencv in VC++

This a very basic program which loads an image and show in a window. Though it is simple it will help you to understand how opencv works, what are different structures used in opencv and to to complie  a simple file.

 So lets under the program.

There are mainly 4 libraies in opencv. which are most used. We are using three here
  1. cv - Main OpenCV functions.
  2. cvaux - Auxiliary (experimental) OpenCV functions.
  3. cxcore - Data structures and linear algebra support.
  4. highgui - GUI functions.
// include the open cv libraries
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"


int main()
{
    IplImage *img=0; // declear an IplImage structure pointer "img"
    img=cvLoadImage("test.jpg",CV_LOAD_IMAGE_UNCHANGED);// load test image to img variable

    cvNamedWindow("image",CV_WINDOW_AUTOSIZE);// create window to image
    cvShowImage("image",img);//show image

    cvWaitKey(0);// wait window to close

    cvDestroyAllWindows();//destroy window
    cvReleaseImage(&img);//release the memory occupied by the image

    return 0;
}

Now let us see how to write your 1st image processing program in VC++. For this:-
  • Open the VC++.Goto file menu in top left. Select new. This will open a new window. Select project tab and select "win32 Consol Application".Write any project name and select the destiantion folder.


  • Now click OK. Then you will be greeted with a second window. Select A "Hello World" application and click the finish button.
  •  Select Project|Settings… option.
  • Select the C/C++ tab and the category Preprocessor 
  • Add the following directories to additional include directories
    C:\Program Files\OpenCV\cv\include
    C:\Program Files\OpenCV\otherlibs\highgui
    C:\Program Files\OpenCV\cxcore\include
  •  Select now the Link Tab, category Input.
  • Add to additional library path the following directories
    C:\Program Files\OpenCV\lib

  • Finally select the category General of the Link tab
  • Add the following libraries to library modules 
    cv.lib highgui.lib cxcore.lib cvaux.lib


  • Setup is valid for the current project .Add all these directories to the global search path
    they will always be active each time you create a new project .
  • Now Compile and Run the program.