<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4416366818620082281</id><updated>2011-10-10T11:19:22.309-07:00</updated><title type='text'>Feel Free</title><subtitle type='html'>Eranga Samararathna's Personal Webspace</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-2332037857742818882</id><published>2011-05-02T03:45:00.000-07:00</published><updated>2011-05-02T03:48:50.246-07:00</updated><title type='text'>Invalid destination address in delivery receipts [ OpenSmpp and Logica ]</title><content type='html'>&lt;div style="text-align: justify;"&gt;Logica SMPP Simulator is the main open source simulator use for testing application developed using SMPP (Short Message Peer to Peer) protocol.&lt;br /&gt;&lt;/div&gt;OpenSmpp/SMS Tools is a recent initiative to build up an open source Java library which implements the SMPP protocol. It is again based on an open source Java SMPP API originally released by Logica.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;I wonder both of these project has a problem with delivery receipts (deliver_sm) in their sample SMSC implementation. The issue I am going to explain should have a big impact if a SMPP application plan to test delivery receipt against above two products.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Refer the method "private void deliver(DeliveryInfoEntry entry)"  of the DeliveryInfoSender.java class.(Logica SMPP Simulatoin in package com.logica.smscsim and OpenSmpp/SMS Tools in package org.smpp.smscsim ).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;It's wrongly setting up delivery receipt destination address.&lt;br /&gt;&lt;br /&gt;Example :&lt;br /&gt;&lt;br /&gt;Assume ESME send message with source address = 0777123233 and destination address = 7878 to SMSC.&lt;br /&gt;&lt;br /&gt;When SMSC replay back to ESME,  SMSC destination address should be 0777123233 and source address should  be 7878&lt;br /&gt;&lt;br /&gt;In an implementation code following changes need to do to support this correctly.&lt;br /&gt;&lt;br /&gt;current&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;deliver.setDestAddr(submit.getDestAddr());&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;need to change as&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;deliver.setDestAddr(submit.getSourceAddr());&lt;/span&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-2332037857742818882?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/2332037857742818882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=2332037857742818882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/2332037857742818882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/2332037857742818882'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2011/05/invalid-destination-address-in-delivery.html' title='Invalid destination address in delivery receipts [ OpenSmpp and Logica ]'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-4826479764293822035</id><published>2010-09-16T05:16:00.000-07:00</published><updated>2010-09-16T05:23:01.862-07:00</updated><title type='text'>Ruby CAS Client with Ruby 1.9.1</title><content type='html'>The existing code base of Ruby CAS client is not compatible with Ruby 1.9.1 and When I test I got following error. &lt;br /&gt;&lt;br /&gt;SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed&lt;br /&gt;&lt;br /&gt;I have modified the existing code base to overcome this issue. Please see the attached link. You can download the modified source from &lt;a href="http://code.google.com/p/rubycas-client/issues/detail?id=41#makechanges"&gt;here.&lt;/a&gt; It works fine with Ruby 1.9.1&lt;br /&gt;&lt;br /&gt;I have added http.verify_mode = OpenSSL::SSL::VERIFY_NONE and https.verify_mode = OpenSSL::SSL::VERIFY_NONE when create http or https connection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-4826479764293822035?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/4826479764293822035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=4826479764293822035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4826479764293822035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4826479764293822035'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2010/09/hi-existing-code-base-of-ruby-cas.html' title='Ruby CAS Client with Ruby 1.9.1'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-4502478292672550094</id><published>2009-04-04T10:54:00.000-07:00</published><updated>2009-04-04T10:57:02.810-07:00</updated><title type='text'>I am back</title><content type='html'>I am back…after being no post for more than 8 months. And I am glad I am finally back. What happened? I have had a difficult time in last quarter and extremely difficult to find a time for writing. But it seems half way ok and I am doing my work as usual. Keeping in your eyeball open I am back!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-4502478292672550094?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/4502478292672550094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=4502478292672550094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4502478292672550094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4502478292672550094'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2009/04/i-am-back.html' title='I am back'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-6257541660302110757</id><published>2008-06-05T06:24:00.000-07:00</published><updated>2008-06-05T06:27:24.701-07:00</updated><title type='text'>How to build ruby OpenAMQ extension</title><content type='html'>Building ruby extension of OpenAMQ is bit painful. I have wrote step by step guide to build ruby extension. Please refer the following URL : http://wiki.openamq.org/addon:ruby-extension/comments/show&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-6257541660302110757?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/6257541660302110757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=6257541660302110757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/6257541660302110757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/6257541660302110757'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/06/how-to-build-ruby-openamq-extension.html' title='How to build ruby OpenAMQ extension'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-1132267369082474506</id><published>2008-04-08T05:18:00.001-07:00</published><updated>2008-04-08T05:23:36.307-07:00</updated><title type='text'>Shutdown hook for C++</title><content type='html'>Shutdown hook is not a strange for Java people. It's there since JDK 1.3 . But for the C++ I couldn't found similar function. I wrote a simple program to demonstrate the some features of shutdown hook using available function in c++. I think C++ library is rich enough to write a complete shutdown hook. But indeed it bit hard when compare to Java.&lt;br /&gt;&lt;br /&gt;When you hit the Ctrl+c following program will call “fnBeforeExit” function before the system get shut.&lt;br /&gt;If you wish you can try this program by replacing never ending loop with “exit(0)”. &lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// File:   Newmain.cc&lt;br /&gt;// Author: eranga&lt;br /&gt;//&lt;br /&gt;// Created on April 8, 2008, 3:52 PM&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;#include &amp;lt stdio.h&amp;gt&lt;br /&gt;#include &amp;lt stdlib.h&amp;gt&lt;br /&gt;#include &amp;lt iostream&amp;gt&lt;br /&gt;#include &amp;lt csignal&amp;gt&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// Shut down hook for C++&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;//Shut down function done all the cleanups&lt;br /&gt;void fnBeforeExit(void) {&lt;br /&gt;    puts("Exit function calls.");&lt;br /&gt;    puts("Do connection close, filde descriptor close...etc in here.");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Function to call when interactive attention signal recieved&lt;br /&gt;//Generally generated by the application user.&lt;br /&gt;void sigint_handler(int sig) {&lt;br /&gt;    std::cout &lt;&lt; "Exit call ( Ctrl + C ) " &lt;&lt; sig &lt;&lt; "\n";&lt;br /&gt;    exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(int argc, char** argv) {&lt;br /&gt;    &lt;br /&gt;    /*&lt;br /&gt;     * The function pointed by the function pointer argument is called when the program terminates normally.&lt;br /&gt;     * If more than one atexit function has been &lt;br /&gt;     * specified by different calls to this function,&lt;br /&gt;     * they are all executed in reverse order as a stack, &lt;br /&gt;     * i.e. the last function specified is the first to be executed at exit.&lt;br /&gt;     * One single function can be registered to be executed at exit more than once.&lt;br /&gt;     * C++ implementations are required to support the registration of at least 32 atexit functions.&lt;br /&gt;     */&lt;br /&gt;    atexit(fnBeforeExit);&lt;br /&gt;    &lt;br /&gt;    std :: cout &lt;&lt; "Program started....." &lt;&lt; std::endl;&lt;br /&gt;    &lt;br /&gt;    /*&lt;br /&gt;     * Specifies a way to handle signals &lt;br /&gt;     * SIGINT - (Signal Interrupt) Interactive attention signal. Generally generated by the application user.&lt;br /&gt;     */&lt;br /&gt;    signal(SIGINT, sigint_handler);&lt;br /&gt;    &lt;br /&gt;    while(true){&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return (EXIT_SUCCESS);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-1132267369082474506?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/1132267369082474506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=1132267369082474506' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/1132267369082474506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/1132267369082474506'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/04/shutdown-hook-for-c_08.html' title='Shutdown hook for C++'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-2946157019590714367</id><published>2008-03-15T09:43:00.000-07:00</published><updated>2008-03-15T10:07:23.323-07:00</updated><title type='text'>Quickfix support for FIX 5.0</title><content type='html'>Still I couldn’t see progressive communication about FIX 5.0 protocol support for Quickfix engine. Some of the user raise this question few times back in the developer mailing list, but still can’t see the green light. The current release of Quickfix 1.12.4 is pretty stable and according to Oren Quickfix willing to support FIX 5.0 near future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-2946157019590714367?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/2946157019590714367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=2946157019590714367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/2946157019590714367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/2946157019590714367'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/03/quickfix-support-for-fix-50.html' title='Quickfix support for FIX 5.0'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-7364487626045284240</id><published>2008-01-13T23:04:00.000-08:00</published><updated>2008-01-13T23:28:11.559-08:00</updated><title type='text'>Long MAX in C++</title><content type='html'>Yesterday I wrote a program to print long max in C++. In 32 bit systems it prints a very small value [ Refer the program ). I am wonder if I want to store a long number which is the most appropriate data type in C++. &lt;br /&gt;&lt;br /&gt;#include &amp;lt stdlib.h&amp;gt&lt;br /&gt;#include &amp;lt iostream&amp;gt&lt;br /&gt;#include &amp;lt limits&amp;gt&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main(int argc, char** argv) {&lt;br /&gt;    &lt;br /&gt;    // Print the long max value&lt;br /&gt;    // 64 bit machine this prints -&gt;  9223372036854775807&lt;br /&gt;    // 32 bit machine this prints -&gt; 2147483647&lt;br /&gt;    cout &lt;&lt; "Max value for long : " &lt;&lt; numeric_limits&lt;long&gt;::max() &lt;&lt; endl;&lt;br /&gt;&lt;br /&gt;    return (EXIT_SUCCESS);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-7364487626045284240?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/7364487626045284240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=7364487626045284240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/7364487626045284240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/7364487626045284240'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/01/long-max-in-c.html' title='Long MAX in C++'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-7958500662342103812</id><published>2008-01-09T22:14:00.000-08:00</published><updated>2008-01-09T22:17:28.910-08:00</updated><title type='text'>Configure printers in Ubuntu</title><content type='html'>It is not very hard to configure printers in Ubuntu. The easiest way is run "http://localhost:631". This will prompt the Common UNIX Printing System.  You can add,remove and manage using this web console. Another way to do this in Xwindow system run System -&gt; Administration -&gt; Printing. This will prompt a window based printer management system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-7958500662342103812?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/7958500662342103812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=7958500662342103812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/7958500662342103812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/7958500662342103812'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/01/configure-printers-in-ubuntu.html' title='Configure printers in Ubuntu'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-4078422581369284099</id><published>2008-01-08T00:43:00.000-08:00</published><updated>2008-01-08T00:45:21.008-08:00</updated><title type='text'>Read Property File from JAVA</title><content type='html'>In most causes we need to keep our configuration information in a property file. This will increase the usability as well as maintainability of a project. This program demonstrate how to read a Java property file and how to extract values from that.&lt;br /&gt;&lt;br /&gt;Sample property file: [ myprop.properties ]&lt;br /&gt;&lt;br /&gt;name=Jeorge&lt;br /&gt;age=17&lt;br /&gt;country=Sri Lanka&lt;br /&gt;city=Colombo&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * Main.java&lt;br /&gt; *&lt;br /&gt; * Created on January 8, 2008, 1:55 PM&lt;br /&gt; *&lt;br /&gt; * To change this template, choose Tools | Template Manager&lt;br /&gt; * and open the template in the editor.&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;package blog2;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.FileInputStream;&lt;br /&gt;import java.io.FileNotFoundException;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.util.Properties;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author eranga&lt;br /&gt; */&lt;br /&gt;public class Main {&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * @param args the command line arguments&lt;br /&gt;     */&lt;br /&gt;    public static void main(String[] args) throws FileNotFoundException, IOException, Exception {&lt;br /&gt;        &lt;br /&gt;        if(args.length != 1){&lt;br /&gt;            throw new Exception("Please provide property file name as a command line parameter !");&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        String propertyFile = args[0];&lt;br /&gt;        File configPropsFile = new File(propertyFile);&lt;br /&gt;        &lt;br /&gt;        if(!configPropsFile.exists())&lt;br /&gt;            throw new Exception("The config file : " + propertyFile + " does not exist.");&lt;br /&gt;        &lt;br /&gt;        Properties myProp = new Properties();&lt;br /&gt;       &lt;br /&gt;        myProp.load(new FileInputStream(propertyFile));&lt;br /&gt;        &lt;br /&gt;        // Access properties&lt;br /&gt;        String prop1 = myProp.getProperty("name");&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-4078422581369284099?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/4078422581369284099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=4078422581369284099' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4078422581369284099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4078422581369284099'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/01/read-property-file-from-java.html' title='Read Property File from JAVA'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-4677135752784114273</id><published>2008-01-07T04:07:00.000-08:00</published><updated>2008-01-07T04:08:21.593-08:00</updated><title type='text'>C++ Pre Processor Commands</title><content type='html'>When you write C++ programs  ( Specially when error handling )you might need to get running file name, current execution line and system time. Following program demonstrate that.&lt;br /&gt;&lt;br /&gt;// &lt;br /&gt;// File:   PreProcessorCommands.cc&lt;br /&gt;// Author: eranga&lt;br /&gt;//&lt;br /&gt;// Created on January 7, 2008, 5:24 PM&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;// &lt;br /&gt;//&lt;br /&gt;int main(int argc, char** argv) {&lt;br /&gt;    &lt;br /&gt;    cout &lt;&lt; "File Name : " &lt;&lt; __FILE__ &lt;&lt; endl;&lt;br /&gt;    cout &lt;&lt; "Current Time : " &lt;&lt; __TIME__ &lt;&lt; endl;&lt;br /&gt;    cout &lt;&lt; "Current Line : " &lt;&lt; __LINE__ &lt;&lt; endl;&lt;br /&gt;    &lt;br /&gt;    return (EXIT_SUCCESS);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-4677135752784114273?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/4677135752784114273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=4677135752784114273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4677135752784114273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/4677135752784114273'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2008/01/c-pre-processor-commands.html' title='C++ Pre Processor Commands'/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-6100294357115104241</id><published>2007-01-11T00:37:00.000-08:00</published><updated>2007-01-11T00:38:42.666-08:00</updated><title type='text'></title><content type='html'>Chanaka, How is this? [ Under Testing ]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-6100294357115104241?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/6100294357115104241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=6100294357115104241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/6100294357115104241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/6100294357115104241'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2007/01/chanaka-how-is-this-under-testing.html' title=''/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-5244426381908503769</id><published>2007-01-09T03:19:00.000-08:00</published><updated>2007-01-09T03:20:10.857-08:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Oh, Still testing............&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-5244426381908503769?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/5244426381908503769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=5244426381908503769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/5244426381908503769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/5244426381908503769'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2007/01/oh-still-testing.html' title=''/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4416366818620082281.post-2430701782076751123</id><published>2007-01-09T03:11:00.000-08:00</published><updated>2007-01-09T03:14:10.004-08:00</updated><title type='text'></title><content type='html'>Under Construction...!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4416366818620082281-2430701782076751123?l=erangac.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://erangac.blogspot.com/feeds/2430701782076751123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4416366818620082281&amp;postID=2430701782076751123' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/2430701782076751123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4416366818620082281/posts/default/2430701782076751123'/><link rel='alternate' type='text/html' href='http://erangac.blogspot.com/2007/01/under-construction.html' title=''/><author><name>Eranga Samararathna</name><uri>http://www.blogger.com/profile/06002354652044348800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_TD6X3I99gig/SxqT4DW0UiI/AAAAAAAAAB8/LjEgBgd_q7s/S220/eranga.jpg'/></author><thr:total>1</thr:total></entry></feed>
