The bit representation of any number of the form 2^n will have only one field set.
If we do an AND operation with the (number-1) the result is 0
i.e (n & n-1) is 0
The number is of form 2^n if (n & n-1) is 0
Read more ...
Search This BlogJul 15, 2008Code to check if a number can be expressed in the form 2^n
The bit representation of any number of the form 2^n will have only one field set. The number is of form 2^n if (n & n-1) is 0 Read more ... May 6, 2008Installing and Configuring Software/Patches on HPUX
The information on individual patches in a patch bundle can be obtained by using /usr/sbin/swlist -s /temp/depot_name -l product -a readme patch_name Patch and software can be installed using the following command. This will open up an interactive interface where you have to select and install the software. /usr/sbin/swinstall -s /directory/depot –x autoreboot=true Read more ... Apr 4, 2008Java - Debugging In Tomcat 5.5
Steps to be followed to enable debugging in Tomcat 5.5 through Eclipse Configuring Tomcat Configuring Eclipse Happy Debugging :) Read more ... Apr 3, 2008Shell Scripting - Parallel Process Execution in Background
Command for checking the background jobs which are in running state jobs -r | wc -l Non-interactive ftp transfer to automate uploading of files parallely on different platforms. #!/bin/bash
LINUX=linux
AIX=aix
SUNOS=sunos
WIN32=win
MACHINES=" \
$LINUX \
$AIX \
$SUNOS \
$WIN32"
function checkjobs(){
if [ `jobs -r | wc -l` -eq 0 ]; then
echo "All Background Process completed Successfully"
return 0
fi
sleep 10
checkjobs
}
function upload(){
if [ $# -eq 0 ]; then
echo "Missing Argument"
exit 1
fi
# Non-interactive ftp transfer
ftp -i -v -n hostname <<END_FTP
user root root
binary
cd test
put "file$1.exe"
bye
END_FTP
echo "Uploaded file$1.exe"
return 0
}
function uploadfile(){
echo "Uploading Files Started"
for host in $MACHINES
do
echo "Uploading FILES on host $host"
upload $host &
done
}
uploadfile
checkjobs
echo "All Files Uploaded Successfully"Making things more simpler, we can use the special command wait and rewrite uploadfile so that we need not check for the background processes function uploadfile(){
echo "Uploading Files Started"
for host in $MACHINES
do
echo "Uploading FILES on host $host"
upload $host &
done
wait
}
uploadfile
echo "All Files Uploaded Successfully"Read more ... Mar 31, 2008Shell Scripting - Rotating Progress Bar
The echo -e command is used to change the term color
Read more ...
Subscribe to:
Posts
(
Atom
)
|
My Blog List |
Labels
AIX
(
2
)
Algorithms
(
15
)
Apache Axis2
(
2
)
Blogging
(
1
)
C#
(
4
)
CMIS
(
2
)
CPP
(
46
)
css 3
(
1
)
Curl
(
1
)
Cygwin
(
3
)
Data Structures
(
10
)
Debugging
(
1
)
Design Patterns
(
5
)
Development
(
1
)
Eclipse
(
4
)
Encoding
(
2
)
General
(
16
)
Generics
(
3
)
HPUX
(
2
)
html
(
1
)
Http
(
1
)
Inspiration
(
3
)
J2EE
(
2
)
Java
(
43
)
Java Web Start
(
2
)
Javascript
(
1
)
JDBC
(
2
)
JNLP
(
2
)
Linux
(
8
)
maven
(
7
)
Multithreading
(
10
)
Objective C
(
1
)
Recursion
(
1
)
Regular Expressions
(
1
)
Servlet
(
2
)
SharePoint
(
3
)
Shell Scripting
(
3
)
spring
(
7
)
SQL Server
(
1
)
SSH
(
2
)
STL
(
1
)
Telnet
(
1
)
Tomcat
(
2
)
Tools N' Utilities
(
3
)
Tree
(
1
)
Ubuntu
(
1
)
VI Editor
(
1
)
Visual Studio
(
4
)
Web Server
(
1
)
Web Services
(
2
)
Windows
(
14
)
|