Tuesday, June 15, 2010

Linux Hacks 1:Change present working directory for cd command using CDPATH

If you are frequently using cd command for browsing subdirectories of a specific parent directory, you can export settings to CDPATH variable and use cd command for all subdirectories without using full path of parent directory.
user@hostname|~#pwd /home/user
user@hostname|~# cd temp
bash: cd: temp: No such file or directory
#This is checking for temp directory under the current  directory....
user@hostname|~# export CDPATH=/media
user@hostname|~# cd temp
/media/temp
user@hostname|/media/temp# pwd
/media/temp

Wednesday, June 2, 2010

JMS Basics, Its Use And Architecture

BASICS
  1. JMS(Java Messaging Service) provides a common way for Java programs to send,create, receive and read an enterprise messaging system’s messages.
  2. It is different from RPC (Remote Procedure Call) because JMS is asynchronous in nature i.e. message sender just sends the message to the destination and continues it’s own processing. The sender does not wait for the receiver to respond but RPC is synchronous in nature i.e. the method invoker waits for the method to finish execution and return the control back to the invoker.
ITS USES
1. JMS in enterprise solution development
Enterprise Application Integration: Where a legacy application is integrated with a new application via messaging.
B2B or Business to Business: Businesses can interact with each other via messaging because JMS allows organizations to cooperate without tightly coupling their business systems.
Geographically dispersed units: JMS can ensure safe exchange of data amongst the geographically dispersed units of an organization.
2. One to many applications
The applications that need to push data in packet to huge number of clients in a one-to-many fashion are good candidates for the use JMS. Typical such applications are Auction Sites, Stock Quote Services etc.
ARCHITECTURE
1. JMS Application contain the following parts…..
JMS Clients: Java programs that send and receive messages.
Non-JMS Clients: Clients that use a message system’s native client API instead of JMS.
Messages: Set of messages that are used to communicate information between its clients.
JMS Provider: Messaging system that implements JMS in addition to the other administrative and control functionality
Administered Objects : Preconfigured JMS objects created by an administrator for the use of clients.
2. Two types of JMS administered objects:
ConnectionFactory: Object a client uses to create a connection with a provider.
Destination : Object a client uses to specify the destination of messages it is sending and the source of messages it receives.
3. JMS Administration
4.Two types of messaging paradigms JMS supports
Point-to-point (PTP),
Publish and Subscribe

Friday, May 28, 2010

Verifying disk sectors using REGS union and SREGS structure

SREGS Structure

This structure of the segment registers, which is passed to and filled by the functions, int86x, intdosx and segread, has been defined in dos.h. Following is the the declaration of the structure:

struct SREGS { unsigned int es; unsigned int cs; unsigned int ss; unsigned int ds; };

REGS union

REGS, the union of two structures, has also been defined in dos.h and it is used to pass information to and from the functions, int86, int86x, intdos and intdosx. The declaration of the union is as follows:

union REGS { struct WORDREGS x; struct BYTEREGS h;

};

void main(void)
{
clrscr();
union REGS rg;
struct SREGS srg;
char bfr[1000];
int i;
rg.h.ah = 4;
rg.h.al = 1;
rg.h.ch = 1;
rg.h.dh = 0;
rg.h.cl = 1;
rg.h.dl = 0x80;
rg.x.bx = FP_OFF(bfr);
srg.es = FP_SEG(bfr);
int86x(0x13,®s,®s,&srg);
printf("rg.x.cflag - %d",rg.x.cflag);
printf("rg.h.ah - %d",rg.h.ah);
printf("rg.h.al - %d",rg.h.al);
printf("Buffer - %d",bfr);
getch();
}
 

About

Site Info

Text

Grey Coderz Copyright © 2010 Site is Designed by Amreesh Tyagi