Friday, December 2, 2011

My Test Simple Java POC

My Test Simple Java POC
-------------------------------
Test doc for basic programming test including design pattern & all common simple java poc

clieck here to download source code

Scjp example
clieck here to download source code


My All Blog Data (blog_dec_07_2011)
clieck here to download source code

Spring ws document
clieck here to download


source path
http://code.google.com/p/mydocumentsstorage/downloads/entry
http://code.google.com/p/mydocumentsstorage/


tomcat6 configuration & multiple tomcat instance configuration
clieck here to download

tomcat7 configuration & multiple tomcat instance configuration
clieck here to download


mavenweb application poc source
clieck here to download project mavenweb
clieck here for war file download war


spring3helloworld poc source
clieck here to download project spring3helloworld
clieck here for war file download war

spring3i18 poc source
clieck here to download project spring3i18
clieck here for war file download war
clieck here for war file download war form submit

spring3mvctiles poc source
clieck here to download project spring3mvctiles
clieck here for war file download war

spring3hibernate poc source
clieck here to download project spring3hibernate
clieck here for war file download war

spring3hibernateTiles poc source
clieck here to download project spring3hibernateTiles
clieck here for war file download war

spring3hibernateTilesi18 poc source
clieck here to download project spring3hibernateTilesi18
clieck here for war file download war

spring3hibernateTilesi18Junit poc source
clieck here to download project spring3hibernateTilesi18Junit
clieck here for war file download war

spring3hibernateTilesi18JunitLog4j poc source
clieck here to download project spring3hibernateTilesi18JunitLog4j
clieck here for war file download war

spring3hibernateTilesi18JunitLog4jDwr poc source
clieck here to download project spring3hibernateTilesi18JunitLog4jDwr
clieck here for war file download war



Above spring poc librery jar files
clieck here to download project jar files



______________________________________________
SAP PI
______________________________________________
My SAP PI Related Data
SAP-PI-MsgMonitoring-Process clieck here to download source code
SAP-PI-TBIT40 clieck here to download document
SAP-PI-TBIT41 clieck here to download document
SAP-PI-TBIT42 clieck here to download document
SAP-PI-TBIT44 clieck here to download document

SAP-PI-BIT400 clieck here to download document
SAP-PI-BIT430 clieck here to download document
SAP-PI-BIT460 clieck here to download document











.

Friday, September 23, 2011

How to upload script files in google code

How to upload script files in google code

1 - First , login to your google account
2 - Go to : http://code.google.com/hosting/
3 - Click "Create a new project"
4 - In the "Create Project windows" :

Project name: Fill with anything but, without space, ie: myjquery

Project summary: Fill with anything , ie : jquery for blog

Project description: Fill with anything . ie : javascript for blogger template...bla..bla

Version control system : Select : "Mercurial"

Source code license : select "GNU General Public License v3"

Tick, Use a separate content license: Select whichever you want

Project labels: fill with anything you want , ie, javascript , or you may leave blank...

Then , click "Create Project"


5 - Uload your file , Click Downloads - New Download ..

6 - Summary: enter your file name , ie : my file , then, click Browse, and put your file..

7 - Labels : fill with anything, ie: Type-Source , then , click "Submit file" Button

8 - To know the url address of your file, click on the file - on the next file, right-click and select "Properties" , Now, in the "Element properties" window, you can see the URL-address of your file , ie : http://myjquery.googlecode.com/files/BarMenu.js

Log4j and Java Log Article


1. Logging Technology
Java Log file is one of the important and most usable technologies for java development. Most of the application maintains its’ own log for future maintenance and trouble shooting. Logging is a good debugging technique in software development.
For example, you can log all exceptions to find out quickly what wrong with the code. Debugging statement-wise can be tedious as you know. Besides, looking up the log file helps in identifying even the most elusive bugs.
You can implement logging functionality in different ways. Here I am trying to explain main two way logging implementation technique.
First, the most popular technique is use third party logging implementation in your application. And second is java provides log classed to implement logging technology with jdk1.4 itself.

2. Log4j Logging Technology
First, the most popular technique is use third party logging implementation in your application. There are many third parties logging jar file available in market. Apache log4j is the most popular and used logger technology. It is very easy to use and configurable for application development.

2.1. Log4j Logging (normal)
This is the most popular and used technology for logging implementation. It is freeware and completely configurable. Only three steps is enough to configure log4j implementation.
Steps are:-
1. Downsload log4j-1.2.15.jar file. Set class path log4j file. Clieck here to download log4j-1.2.15.jar http://www.findjar.com/jar/log4j/jars/log4j-1.2.15.jar.html .
2. Create log4j.properties file. Configure logger appender, log file path, log message format and log message level.
3. Now logger configuration ready and use logger in your class file.

2.1.1. Directory structure
The directory structure of the example is shown below:-



 
2.1.2. File log4j.properties
#===========================================
# logger appender level
# DEBUG=> logger level for Console
# CA=> log messages in Console;
# FILE=> log messages in File
#===========================================
log4j.rootLogger=DEBUG,CA,FILE

#===========================================
# File log Appender Configuration.
#This is required if you want to write log message in file.
#===========================================
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=example.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

#============================================
# ConsoleAppender Configuration.
#This is required if you want to write log message in file.
#============================================
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

#============================================
#Package Level log Appender.Add this poetion if need package level log.
#This is not mandatory. If it is required then configure this portion.
#log4j.logger.=
#log4j.appender.=org.apache.log4j.FileAppender
#=============================================
log4j.appender.JavaLog4jExampleFileAppender=org.apache.log4j.FileAppender
log4j.appender.JavaLog4jExampleFileAppender.File=example.log
log4j.appender.JavaLog4jExampleFileAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.JavaLog4jExampleFileAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.logger.paria.league.java.log4j.example=WARN,JavaLog4jExampleFileAppender
 
2.1.3. log4j.propeties screen shoot.


 
2.1.4. Java class file for logger
package paria.league.java.log4j.example;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class JavaLog4jExample {

static Logger logger = Logger.getLogger(JavaLog4jExample.class);

public static void main(String[] args) {
PropertyConfigurator.configure("log4j.properties");
logger.debug("Sample debug message");
logger.info("Sample info message");
logger.warn("Sample warn message");
logger.error("Sample error message");
logger.fatal("Sample fatal message");
}

}
2.1.5. Log message java class screen shoot.


 
2.2. Log4j Rolling File Appender (size wise)
Logger messages will be append in the log file. If it is continuously happened log file will be increase. If you need to archive the log file according to the file size limit then need to configure log file appender as RollingFileAppender. When file size exceed more than configured file size then new log file will be created and old file will be archived. This rolling appender file is used for file size limit archive.

2.2.1. File log4j.properties
#=============================================
# BEGIN APPENDER: ROLLING FILE APPENDER (rolling)
log4j.rootLogger=DEBUG, rolling

# first: type of appender (fully qualified class name)
log4j.appender.rolling=org.apache.log4j.RollingFileAppender

# second: Any configuration information needed for that appender.
# Many appenders require a layout.
log4j.appender.rolling.File=example.log
log4j.appender.rolling.MaxFileSize=1KB

# Keep one backup file
log4j.appender.rolling.MaxBackupIndex=1
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

# END APPENDER: ROLLING FILE APPENDER (rolling)
#==========================================

According to log4j file configuration, log file message will be append in the example.log file. When example.log file size will be exceed 1KB size then new example.log file will be archived as example.log.1 and another new example.log file will be created.


2.2.2. Directory structure
The directory structure with rolling archived file example (size wise) is shown below.


 
2.3. Log4j Rolling File Appender (time wise)
Logger messages will be append in the log file. If it is continuously happened log file will be increase. If you need to archive the log file according to the file time limit then need to configure log file appender as DaillyRollingFileAppender. When time limit exceed more than configured time span then new log file will be created and old file will be archived. This rolling appender file is used for file time limit archive.


2.3.1. File log4j.properties
#================================================
# BEGIN APPENDER: DAILY ROLLING FILE APPENDER (rolling)
log4j.rootLogger=DEBUG, R

#log4j.properties file create an appender of type DailyRollingFileAppender:
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender

#define the date pattern which will be used in naming the log files:
log4j.appender.R.DatePattern='-'yyyy-MM-dd-hh-mm'.log'

#define the path of your log files:
log4j.appender.R.File=example.log

#and configure how logs should appear inside the file:
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
# END APPENDER: DAILY ROLLING FILE APPENDER (rolling)
#============================================
According to log4j file configuration, log file message will be append in the example.log file. Here configured for every minute log file will be archived. After one minute example.log file will be archived as example.log-2011-09-22-15-01.log and another new example.log file will be created. If you need to customize file name then provide log4j.appender.R.DatePattern and log4j.appender.R.File properties pattern.


2.3.2. Directory structure
The directory structure with rolling archived file example (time wise) is shown below.



2.3.3. Example Custom Description
If you want archive file name pattern like FileName-yyyy-MM-dd.log i.e. example.log as example-2011-09-22.log then provide log4j.appender.R.DatePattern and log4j.appender.R.File properties pattern as bellow:-
log4j.appender.R.DatePattern='-'yyyy-MM-dd'.log'
log4j.appender.R.File=example

3. Java Log Technology
Java provides log classed to implement logging technology with jdk1.4 itself. Sometimes third party log is not suitable for the application then java log is very useful. Not only third party issue, you can use java log as logger technology in your application. Here you have to write your own code for it.


3.1. Java Log Rolling File (time & size wise)
Here this log file implements logger implementation. This java class completely java based class, not jar file is required. This is simple basic log implementation class. I provide default log file name size etc, if you need flexibility please implement properties file for configuration of those hard code valued for your application.


3.1.1. Java log file class.
Copy this class in your application and use log implementation in your application. If you need more customize please customize. Here all customize parameter provides for logging level, date, file naming convention etc.


package paria.league.java.log.example;

import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;

/**
* This class implements java log file for date and size wise wise rolling file. It will create new log file every minute. If log file size increase more than.1KB then it will create new file with same time stamp with sequence number. As Example, log file name javaLog_09-23-2011-00-57_0.log (javaLog_.log) on sep-20,2011 00:57 and lat it added sequence as 0. If log file size increase more than 1KB then for within a minute then it will increase sequence as 1.
*
* @author aparia Sep-09,2011
* @Copywrite paria league
*/
public class JavaLogExample {
private static Logger logger = Logger.getLogger("JavaLogExample");
private static String logFileName = null;
private static int logFileLimit = 0;
private static FileHandler logFileHandler;

/**
* This static bloc set the file name file size and file name patter with time stamp format.
*
* @author aparia Sep-09,2011
*/
static {
try {
logFileName = "javaLog";
logFileLimit = 1024;
SimpleDateFormat DateTime =
new SimpleDateFormat("MM-dd-yyyy-HH-mm");
DateTime.setTimeZone(TimeZone.getTimeZone("EST"));
String now = DateTime.format(new Date());
logFileHandler =
new FileHandler(logFileName + "_" + now.toString()
+ "_%g.log", logFileLimit, 200, true);

} catch (SecurityException e) {
} catch (IOException e) {
} catch (Exception e) {
}

}

/**
* Private default constructor
*
* @author aparia Sep-09,2011
*/
private JavaLogExample() {
}

/**
* This method returns JavaLogExample instance.
*
* @author aparia Sep-09,2011
* @return JavaLogExample
*/
public static JavaLogExample getLogger() {
return new JavaLogExample();
}

/**
* This method format logger message format and write message in log file permanently. Here message argument is for log messages and level for logging level.
* Here this level is not implemented. If you want to implement logging level write a java class and provide the logging level as integer value.
*
* @author aparia Sep-09,2011
* @param message
* @param level
*/
private static void append(String message, int level) {
final String logMsg = message;
logFileHandler.setFormatter(new Formatter() {
public String format(LogRecord rec) {
DateFormat dateFormat = new SimpleDateFormat(
"MM.dd.yyyy hh:mm:ss a zzz");
Date date = new Date();
String sLevel = "1";
StringBuffer buf = new StringBuffer(1000);
buf.append("[" + dateFormat.format(date) + "]");
buf.append("[" + sLevel + "]");
buf.append(" - ");
buf.append(logMsg);
buf.append("\r\n");
String logFormatStr = buf.toString();
return logFormatStr;
}
});
logger.addHandler(logFileHandler);
logger.log(Level.INFO, message);
}

/**
* This method logged debug message
*
* @author aparia Sep-09,2011
* @param message
*/
public void debug(String message) {
JavaLogExample.append(message, 0);
}

/**
* This method logged info message
*
* @author aparia Sep-09,2011
* @param message
*/
public void info(String message) {
JavaLogExample.append(message, 1);
}

/**
* This method warning debug message
*
* @author aparia Sep-09,2011
* @param message
*/
public void warn(String message) {
JavaLogExample.append(message, 2);
}

/**
* This method logged error message
*
* @author aparia Sep-09,2011
* @param message
*/
public void error(String message) {
JavaLogExample.append(message, 3);
}

}


3.1.2. Java log test class.
This java class for test java log implementation. Run this class to test logger messages. It will create java log file as javaLog_09-23-2011-00-30_0.log and last sequence will be increate according to the log file size in the specific time frame. If javaLog_09-23-2011-00-30_0.log file size increased more than 1KB then archive file name will be javaLog_09-23-2011-00-30_1.log. If you run again after one minute then it will create new log file like javaLog_09-23-2011-00-31_0.log or javaLog_09-23-2011-00-31_1.log according to the file size.
package paria.league.java.log.example;

/**
* This java for test java log implementation
* @author aparia Sep-232,2011
*
*/
public class JavLogTestMain {

/**
* java logger file instance
*/
private static final JavaLogExample logger= JavaLogExample.getLogger();

/**
* Main method to run and log messages
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
logger.debug("debug mation test");
logger.info("infor mation test");
logger.warn("warning mation test");
logger.error("error mation test");
}
}
 
3.1.3. Directory structure
The directory structure with rolling archived file example (time wise and size wise) is shown below.



4. Log Technology project code
download log4j and java log scorce code click here


Friday, August 19, 2011

Hai To Tomar Jonno

Hai To Tomar Jonno
---------------------------------
May be it is for you that
I have become love’s slave
I know that you are unmatched
But I extend my hands for your support
Whenever in solitude
I have vearned for you
I have rushed for always from
The beginning to the end of this world
I am immersed in myself
I know not vour openion
Even if something unusal happens
Still I would need you always

May be it is for you that
I have become love’s slave
I know that you are unmatched
But I extend my hands for your support
Whenever in solitude

I am so dangerously in love
Seeing only happiness in my eyes
I spread my dreams though
The air in all directions
You have not said I’m bad
Still why this resistance
Do not be ruled by your mind
Let’s leave everything and go.

May be it is for you that
I have become love’s slave
I know that you are unmatched
But I extend my hands for your support
Whenever in solitude
I have vearned for you
I have rushed for always from
The beginning to the end of this world

Swami Vivekananda's Concluding Speeches

Swami Vivekananda's Speeches
The World Parliament of Religions, Chicago


Swami Vivekananda

CONCLUDING ADDRESS - Chicago, Sept 27, 1893

The World's Parliament of Religions has become an accomplished fact, and the merciful Father has helped those who labored to bring it into existence, and crowned with success their most unselfish labor.


Swami Vivekananda, ParamHanswa Ramakrishna Dev, Sarada Maa

My thanks to those noble souls whose large hearts and love of truth first dreamed this wonderful dream and then realized it. My thanks to the shower of liberal sentiments that has overflowed this platform. My thanks to this enlightened audience for their uniform kindness to me and for their appreciation of every thought that tends to smooth the friction of religions. A few jarring notes were heard from time to time in this harmony. My special thanks to them, for they have, by their striking contrast, made general harmony the sweeter.
Much has been said of the common ground of religious unity. I am not going just now to venture my own theory. But if anyone here hopes that this unity will come by the triumph of any one of the religions and the destruction of the others, to him I say, "Brother, yours is an impossible hope." Do I wish that the Christian would become Hindu? God forbid. Do I wish that the Hindu or Buddhist would become Christian? God forbid.


Parliament of Religions In Chicago

The seed is put in the ground, and earth and air and water are placed around it. Does the seed become the earth, or the air, or the water? No. It becomes a plant. It develops after the law of its own growth, assimilates the air, the earth, and the water, converts them into plant substance, and grows into a plant.
Similar is the case with religion. The Christian is not to become a Hindu or a Buddhist, nor a Hindu or a Buddhist to become a Christian. But each must assimilate the spirit of the others and yet preserve his individuality and grow according to his own law of growth.
If the Parliament of Religions has shown anything to the world, it is this: It has proved to the world that holiness, purity and charity are not the exclusive possessions of any church in the world, and that every system has produced men and women of the most exalted character. In the face of this evidence, if anybody dreams of the exclusive survival of his own religion and the destruction of the others, I pity him from the bottom of my heart, and point out to him that upon the banner of every religion will soon be written in spite of resistance: "Help and not fight," "Assimilation and not Destruction," "Harmony and Peace and not Dissension."


Swami Vivekananda's Welcome Speeches



Swami Vivekananda's Speeches
The World Parliament of Religions, Chicago

Swami Vivekananda

WELCOME ADDRESS - Chicago, Sept 11, 1893

Sisters and Brothers of America,

It fills my heart with joy unspeakable to rise in response to the warm and cordial welcome which you have given us. I thank you in the name of the most ancient order of monks in the world; I thank you in the name of the mother of religions, and I thank you in the name of millions and millions of Hindu people of all classes and sects.


Swami Vivekananda, ParamHanswa Ramakrishna Dev, Sarada Maa

My thanks, also, to some of the speakers on this platform who, referring to the delegates from the Orient, have told you that these men from far-off nations may well claim the honor of bearing to different lands the idea of toleration. I am proud to belong to a religion which has taught the world both tolerance and universal acceptance. We believe not only in universal toleration, but we accept all religions as true. I am proud to belong to a nation which has sheltered the persecuted and the refugees of all religions and all nations of the earth. I am proud to tell you that we have gathered in our bosom the purest remnant of the Israelites, who came to Southern India and took refuge with us in the very year in which their holy temple was shattered to pieces by Roman tyranny. I am proud to belong to the religion which has sheltered and is still fostering the remnant of the grand Zoroastrian nation. I will quote to you, brethren, a few lines from a hymn which I remember to have repeated from my earliest boyhood, which is every day repeated by millions of human beings: "As the different streams having their sources in different paths which men take through different tendencies, various though they appear, crooked or straight, all lead to Thee."


Parliament of Religions In Chicago

The present convention, which is one of the most august assemblies ever held, is in itself a vindication, a declaration to the world of the wonderful doctrine preached in the Gita: "Whosoever comes to Me, through whatsoever form, I reach him; all men are struggling through paths which in the end lead to me." Sectarianism, bigotry, and its horrible descendant, fanaticism, have long possessed this beautiful earth. They have filled the earth with violence, drenched it often and often with human blood, destroyed civilization and sent whole nations to despair. Had it not been for these horrible demons, human society would be far more advanced than it is now. But their time is come; and I fervently hope that the bell that tolled this morning in honor of this convention may be the death-knell of all fanaticism, of all persecutions with the sword or with the pen, and of all uncharitable feelings between persons wending their way to the same goal.

Who is the leader of youth of INDIA ..................... ??




ARVIND KEJRIVAL:-

Mechanical Engineer -IIT Kharagpur

Job :-Tata Steel
Former IRS (Indian Revenue Service) resigned from the Govt. job (posted IT Commissioner’s office)

Social Activist:-
Man behind (Right to Information Act).
LokPal bill

Awards Various Ashoka Fellow, Civic Engagement.
2005: 'Satyendra Dubey Memorial Award', IIT Kanpur for his campaign for bringing transparency in Government
2006: Ramon Magsaysay Award for Emergent Leadership.
2006: CNN-IBN, 'Indian of the Year' in Public Service
2009: Distinguished Alumnus Award, IIT Kharagpur for Emergent Leadership.
2010: Policy Change Agent of the Year, Economic Times Corporate Excellence Award along with Aruna Roy.
Fighting against corruption

.............He left his job in IRS to fight against corruption.

===============================================

RAHUL GANDHI :-
Education- failed to secure passing grades in National Economic Planning and Policy graduated by any how
job: Got ancestral political power and running through it
Award: he is making awards not getting it
Fight against Indians sentiments

For him Terror attacks are common thing...
we should not be worried of that.....let it happen(since they have z class security)

he will never talk about Govt. policies....and planning....since he
is not intelligent enough to grasp that.(claimed to be most eligible to be PM)

Won't talk about black money and corruption.

will never talk in Parliament.

No political vision and goals for nation .

Trained well to fool poor villagers with safed kurta ..nd khadhi(doing same in UP and other places.)

Rahul had violated Section 144 of CrPC in Uttar Pradesh when he visited the villages of Bhatta-Parsaul earlier this year.
Home minister P Chidambaram backed him.

Achievements:-
Grandson OF Nehru,
Grandson of Indira Gandhi....
Son Of Rajiv gandhi....
FRom Gandhi Family.....
till now zero...

===========================================


Who is the leader of youth of INDIA ..................... ??



Don’t do things for someone's satisfaction do it for self-satisfaction. -


Thanks and regards,