Friday, August 13, 2010

Converting POD To html ( Plain Old Documentation to HTML Conversion)

First you should know what is POD, so for Writing Documentation in Perl Modules Check Article "Plain OLD Documentation". After reading this article you will know what is POD and then point comes to convert it to distributable format i.e. html format, so no one will have to look into your perl code and one can know what all is there in that particular module.

There is a module in Perl Called as "pod2html" which gives details on how to convert pod to html.
 Following is the command line for converting pod 2 html :

 pod2html --help --htmlroot= --infile=
                           --outfile=  --podpath=:...:
                           --podroot= --libpods=:...:
                           --recurse --norecurse --verbos
                           --index --noindex --title=

--htmlroot: Root path when creating HTML File from pod.
--infile: Specify the pod file name to convert to html 
--outfile: HTML Filename to be created, if not given then output will go to STDOUT
--index : Creates index at TOP of HTML File (Default)
--noindex: Oppsite of "--index", don't create index at top
--recurse: Recurse into subdirectories specified in podpath(default)
--norecurse: Do not recurse
--title: Title of resulting HTML File
--verbose: Display progress messages
--podroot: Base directory for finding library pods



Example: pod2html --infile=Test.pm --outfile=Test.html --header --index --backlink="Go Back to Top"

 For further study: POD::HTMLPlain OLD Documentation



Friday, July 30, 2010

Replacing ^M character at end of line using VI editor ( ^H, ^G and so on..)

Some time these characters are placed when you convert file from DOS format to Linux format. These characters can be viewed only with Vi editor or either typing "cat -v" command for that file in command prompt. These characters are called control characters.

These characters can be deleted using ":%s/.$//g" command from VI prompt.
To replace character use it like ":%s/.$/replace/g" Press Ctrl Q+M, and this will character will come up. In some other format it can be typed using ctrl V+M.

But before doing all this do ":set ff=dos", to change file format to DOS.

At last a simple trick for Gvim on Windows XP:
:%s/\r/\r/g
This replaces unix carriage return by windows CRLF.

following is the list of Ctrl characters:

Hex Name
0x00 NUL
0x01 SOH, Control-A
0x02 STX, Control-B
0x03 ETX, Control-C
0x04 EOT, Control-D
0x05 ENQ, Control-E
0x06 ACK, Control-F
0x07 BEL, Control-G
0x08 BS, backspace, Control-H
0x09 HT, tab, Control-I
0x0a LF, line feed, newline, Control-J
0x0b VT, Control-K
0x0c FF, form feed, NP, Control-L
0x0d CR, carriage return, Control-M
0x0e SO, Control-N
0x0f SI, Control-O
0x10 DLE, Control-P
0x11 DC1, XON, Control-Q
0x12 DC2, Control-R
0x13 DC3, XOFF, Control-S
0x14 DC4, Control-T
0x15 NAK, Control-U
0x16 SYN, Control-V
0x17 ETB, Control-W
0x18 CAN, Control-X
0x19 EM, Control-Y
0x1a SUB, Control-Z

Thursday, July 15, 2010

Searching and replacing in VIM

Vim has a command ":s(substitute)" for search and replace text. It searches for text and replace the text.

:%s/abc/xyz/g 
Find each occurrence of 'abc', and replace it with 'xyz'.


:%s/\<abc\>/xyz/gc 
Change only whole words exactly matching 'abc' to 'xyz'; ask for confirmation.

:%s/abc/xyz/gci
Change each 'abc' (case insensitive) to 'xyz'; ask for confirmation.

:%s/abc/xyz/gcI 
Change each 'abc' (case sensitive) to 'xyz'; ask for confirmation.

:s/abc/xyz/g
Replaces in current line only
 :%s/abc/xyz/g
Replaces in all lines
:4,8s/abc/xyz/g
Replaces all abc by xyz in lines between 4 & 8


So ":%s" is equivalent to ":1,$s"

Modifiers:
g: GLobal
c: confirmation
i: case insensitive
I: Case sensitive

Reference: VIM Wiki

Saturday, July 10, 2010

Get more detailed Info on your computer

Hi,
I know you want to know details about your computer's directx componets and their drivers are installed, and what they are using. this tool lets you diagnose problems and change your system settings to best. So to check more detailed info on your computer, which is not even available on My computer->Properties section, Follow the steps:
1. Open RUN Prompt.
2. type dxdiag and enter
3. Make sure you have original version version of XP because it will propmt for that.
4. Once it opens up it will show information on : System, DirectsX Files, Music, Display, Sound, Input devices etc..
5. To save this info click on "Save all information" and select the location. Information will be saved in form of .txt file.