Friday, December 12, 2008

Thursday, August 21, 2008

Numbering and Bulleting In MS Word 2007 docx format

This explains the logic behind Numbering and Bulleting in Docx format.
Important files.

1. document.xml inside folder /word
2. numbering.xml inside folder /word

Inside document.xml you find tag like this


.......................


.......................




.................

Here tag is important , this refers to the information about number or bullets.
Inside numbering.xml you will find tags:

..............

......




Follw0ing three links plays role: <
1. From document.xml//w:p/w:pPr/w:numPr/w:numId/@ w:val
links to
numbering.xml/w:num/@w:numId
2. From numbering.xml/w:num/w:abstractNumId/@w:val
links to
numbering.xml/w:abstractNum/@ w:abstractNumId
3. From document.xml//w:p/w:pPr/w:numPr/w:ilvl/@w:val
links to
numbering.xml/w:abstractNum/w:lvl/@w:ilvl
Seems little trick but well linked.
document.xml has links to and to be selected , while numbering.xml has link to which to be selected.
One more thing, numId in numbering.xml starts from 1 while w:abstractNumId starts from 0.
For any issue not understood , please feel free to mail me.
Cheers!
H!manshu

Wednesday, July 23, 2008

To check type of variable in XQuery

XQuery has a very easy way to check type of variable same as Java.

Use
$variable instance of 'type'
where 'type' can be
xs:string
xs:date
or any type you want to check.

Wednesday, July 16, 2008

Search Using Grep

1. grep -r "keyword" .
here we are searching for the word "keyword" , in current directory and sub-directories.
This will return the list of files and lines which contain this word.
2. grep -lr "modules" .
This will return only list of files .
3. grep -lr "mod.*" .
grep also supports regular expressions

General tag : grep "options" "keyword" "drive specification"

Where options are:

-a All disks.
-c Show the matched characters in Colour.
-f List the File name.
-h Hard disks only.
-i Make the pattern case Insensitive.
-n List the line Number.
-o Only list the file name.
-s Subdirectories.
-x List the lines which do NOT have the pattern in them.

There are many more options , to explore use:
grep man

Tuesday, July 15, 2008

Cron on Linux ( Learn easy and fast)

Schedule a job on Linux Machine. ( Job Scheduler)
1. Using Cron$ crontab -ewhich will start the editor (or vi) and load the current cron table file for this user, or a blank file if none exists.
2. Time Discription
#mh hd dm my dw command
(every line starting with a pound symbol (#) is a comment) fields are:
minute of the hour
hour of the day
day of the month
month of the year
day of the week
command line
3. Crontab Examples
0 12 * * * /opt/command.sh
This command will execute every day at noon.

4. Cron Job Output
0 12 * * * /opt/command.sh > /opt/file.log
output of command.sh will be overwritten to file.log everytime cron job runs
0 12 * * * /opt/command.sh >> /opt/file.log
output of command.sh will be appended to file.log everytime cron job runs

Check time on Linux Machine

Use
date
hwclock

Tuesday, June 3, 2008

Installing Java 1.5 on linux 64-bit Machine

1. Download jdk from here:

http://cds-esd.sun.com/ESD39/JSCDL/jdk/5.0_15/jdk-1_5_0_15-linux-amd64-rpm.bin?AuthParam=1212502176_37e9eeebbc1a57c5c24004ebc6ec106c&TicketId=nodzBV0QRXZwluEqlUWeV5ubcQ%3D%3D&GroupName=CDS&FilePath=/ESD39/JSCDL/jdk/5.0_15/jdk-1_5_0_15-linux-amd64-rpm.bin&File=jdk-1_5_0_15-linux-amd64-rpm.bin
(Note: Don't confuse by the name amd64 here , this version is for intel also)

2. At the promt window : Enter :su
3. Enter the root password.
4. Change to the directory in which you want to install.

Type: cd directorypath

5. Change the permission of the file to make it executable.

Type: chmod a+x jre-1_5_0_02-linux-amd64-rpm.bin
6. Verify that you have excutable permission on the file.

Type: ls -l
7. To start the installation process,

type:. /jre-1_5_0_02-linux-amd64-rpm.bin

8. License agreement will be displayed. Press the spacebar to display the next page. At the end, enter yes to proceed with the installation.
9. The installation file creates jre-1_5_0_02-linux-amd64.rpm file in the current directory.
Run the RPM command at the terminal to install the packages.

Type: rpm -iv jre-1_5_0_02-linux-amd64.rpm
The JRE is installed in jre1.5.0_(version number) sub-directory under the current directory.

Monday, May 19, 2008

Useful Linux Commands

Installing Java:
1. chmod 744 jre-1_5_0_15-linux-amd64-rpm.bin
2. Run ./jre-1_5_0_15-linux-amd64-rpm.bin \
java is intalled.
Now to make it active do following:
1. edit .bashrc
2. add PATH=$PATH:/usr/local/bin
where /usr/local/bin is the pate where java is installed.
If you dont want to edit Path variable than create symbolic link (ln) in directory /usr/bin for java, javac , and other utilities you want to use of jre.

Installing Tomcat:
1. Unjar tomcat.tar in the directory you wish to set up tomcat.
2. put following tomcat script in /etc/init.d/
---------------script tomcat----------------------
# This is the init script for starting up the
# Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# Source function library. . /etc/rc.d/init.d/functions
# Get config. . /etc/sysconfig/network
# Check that networking is up.[ "${NETWORKING}" = "no" ] && exit 0
tomcat=/usr/local/tomcat/apache-tomcat-6.0.16
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
start(){
echo -n $"Starting Tomcat service: "
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
action $"Stopping Tomcat service: " $shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
# This doesn't work ;)
status tomcat
;;
restart )
restart
;;
*)
echo $"Usage: $0 {startstopstatusrestart}"
exit 1
esac
exit 0
-----------------------------------------------------------------------------------
3. chmod a+x tomcat
4. chkconfig --add tomcat and your service is set :
use "service tomcat start" command to test your service
5. to check tomcat is running ------------------ netstat -vatn grep 8080
6. " dos2unix tomcat" to fix dos to unix conversion issue tomcat" to fix dos to unix conversion issue

Wednesday, May 14, 2008

Swimming Pool in Noida

Hi,
I have joined the swimming pool in Sector-24 , Kendriya Vidhalaya.
Monthly Fee- 1200/-
Seasonal Fee- 4000/- valid till 15-oct-08.
You can visit the pool in morning and evening.

Tuesday, May 13, 2008

My first post

Hi All,
Yesterday was my birthday and it came in my mind to start blogging.
Here I will be share  the purpose of creating this blog . Through this  blog I will be publishing information related to computer science , nature , places around and anything which I found useful to share.
Well thats all for the first blog of mine.
Hope i will be writing continuously here.
Regards,
Himanshu