Download Presentation Videos from InfoQ

InfoQ is a very resource full web site for anyone in the software industry. They have lot of articles, white papers, and presentations in various topics related to software engineering. Presentation videos found in InfoQ have being recorded during various conferences and are really useful. I really love watching those videos since it is great opportunity to listen to industry experts.

But the problem was that I had to sit in front of the browser and watch those videos. So I though of downloading those videos watch them when I have free time, or when I'm traveling. So I tried to download the flv using many of the free tools available in the web. But they were not successful at all. After many unsuccessful attempts, I found a way to download those presentations. It is a tool called Grub-Pro coming with Orbit-Downloader. Here is the tutorial for it. Only issue with this tool is that you have to use Internet Explorer. But no worries, as long as I can download the video, I don't mind even using IE for a while :)

grub-pro-in-IE

grub-pro-download

 

Task Focused Programing with Mylyn and TaskTop

Few days back I came across this presentation at InfoQ site regarding "Eclipse, Mylyn and the TFI". I've seen the Mylyn view in the Eclipse and my idea about that was like some kind of a task management tool that comes with Eclipse IDE. After watching the vide my idea about Mylyn changed a lot and I was really exited about Mylyn and wanted to give it a try.  Mylyn is an open source product, there is a commercial version as well, which is called TaskTop. In task top there is a free version called "TaskTop Starter" which has some more features like Time Tracking.

Installing Mylyn and TaskTop

Mylyn comes by default with many of Eclipse editions. I was using Eclipse JEE Developer edition and it already had Mylyn. So most probably you also having it already. If you don't have Mylyn pug-in already installed in your Eclipse you can get it from Eclipse site. It has all the instruction you need to install it.

Once you install Mylyn you'll get a new view called "Task". If it is not already shown you can get it from Window -> Show View -> Other.

task-view

To install TaskTop starter edition follow the instructions given in TaskTop site. Before installing TaskTop you should do a complete update of your Eclipse. Otherwise you'll get some errors regarding incompatibilities.

Some Interesting Features of Mylyn/TaskTop

Mylyn is all about task focused programing. It allows you to do multitasking with ease. When you create a task all the editors you open are attached to that task. So when you move to another task you can see all the file which you had opened already there. You don't need to waist time on opening and closing editors when switching from one task to another.  Trust me this can improve your productivity many times. I personally experiences this during last tow days

I used mylyn.

task-list

creating-new-task 

You can also integrate bug reports from common bug tracking systems like bugzilla and Jira. Most interesting thing about this is that you can share how you fix the bug with other developers as well. Lett's say you had to open 5 files and do changes in order to fix the bug. When you mark the bug as Fixed you can also attach Mylyn context as well. So when other open it, mylyn will automatically open the files you have opened when you fixed that bug.

Another interesting thing is you can see how you have spent your time on various tasks you have performed during the day. This feature comes with the TaskTop Starter.

time-tracking

There are many more interesting things regarding Mylyn. This is only an enlightment article. If you are interested you should watch that InfoQ video.

 

 

SCTP Client-Server in Java

As I promised in my previous article here is very simple Client Server example for SCTP in Java. If you still have not installed and tested OpenJDK please follow the instructions given in my previous article.

SCTP Server

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;

import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpServerChannel;

/**
* @author sandarenu
* $LastChangedDate$
* $LastChangedBy$
* $LastChangedRevision$
*/
public class SctpServer {

    public static void main(String[] args) throws IOException {
        SocketAddress serverSocketAddress = new InetSocketAddress(1111);
        System.out.println("create and bind for sctp address");
        SctpServerChannel sctpServerChannel =  SctpServerChannel.open().bind(serverSocketAddress);
        System.out.println("address bind process finished successfully");

        SctpChannel sctpChannel;
        while ((sctpChannel = sctpServerChannel.accept()) != null) {
            System.out.println("client connection received");
            System.out.println("sctpChannel.getRemoteAddresses() = " + sctpChannel.getRemoteAddresses());
            System.out.println("sctpChannel.association() = " + sctpChannel.association());
            MessageInfo messageInfo = sctpChannel.receive(ByteBuffer.allocate(64000) , null, null);
            System.out.println(messageInfo);

        }
    }
}

SCTP Client

 

import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;

import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.SctpChannel;

/**
* @author sandarenu
* $LastChangedDate$
* $LastChangedBy$
* $LastChangedRevision$
*/
public class SctpClient {

    public static void main(String[] args) throws IOException {
        try {
            SocketAddress socketAddress = new InetSocketAddress( 6050);
            System.out.println("open connection for socket [" + socketAddress + "]");
            SctpChannel sctpChannel = SctpChannel.open();//(socketAddress, 1 ,1 );
            sctpChannel.bind(new InetSocketAddress( 6060));
            sctpChannel.connect(socketAddress, 1 ,1);

            System.out.println("sctpChannel.getRemoteAddresses() = " + sctpChannel.getRemoteAddresses());
            System.out.println("sctpChannel.getAllLocalAddresses() = " + sctpChannel.getAllLocalAddresses());
            System.out.println("sctpChannel.isConnectionPending() = " + sctpChannel.isConnectionPending());
            System.out.println("sctpChannel.isOpen() = " + sctpChannel.isOpen());
            System.out.println("sctpChannel.isRegistered() = " + sctpChannel.isRegistered());
            System.out.println("sctpChannel.provider() = " + sctpChannel.provider());
            System.out.println("sctpChannel.association() = " + sctpChannel.association());

            System.out.println("send bytes");
            final ByteBuffer byteBuffer = ByteBuffer.allocate(64000);
            //Simple M3ua ASP_Up message
            byte [] message = new byte []{1,0,3,1,0,0,0,24,0,17,0,8,0,0,0,1,0,4,0,8,84,101,115,116};

            final MessageInfo messageInfo = MessageInfo.createOutGoing(null, 0);
            System.out.println("messageInfo = " + messageInfo);
            System.out.println("messageInfo.streamNumber() = " + messageInfo.streamNumber());

            byteBuffer.put(message);
            byteBuffer.flip();

            try {
                sctpChannel.send(byteBuffer, messageInfo);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("close connection");
            sctpChannel.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Technorati Tags: ,,,

 

Communicating over SCTP in Java

SCTP - Stream Control Transmission Protocol is a relatively new (standardize in year 200 by IETF) transport layer protocol to design to operate over IP. It is an alternative for TCP and UDP and combines many good features of those protocols. Main intention of developing SCTP was to cater the growing demand of IP telephony market. 

Since SCTP is relatively new protocol programming language support for this is also not as commonly available as TCP or UDP, especially you are Java developer. But is you are a C/C++ developer then you have no problem, there is a very good guide on UNIX - Network Programing Vol1-3rd Edition (chapter 9, 10 and 23).

If you are Java developer then you'd have to use OpenJDK instead of Sun java JDK, since at present only OpenJDK has the support for SCTP. So first thing you have do is to download and install OpenJDK-7.  Currently it only has versions for Linux and Solaris, again if you are using Windows then you'll have to do some more research. I've tried this only on Linux(Fedora), may be later I'll try with Windows as well. If your Linux kernel do not support SCTP, then you'll have install LKSCTP as well. Here is the small getting started guide at OpenJDK site. You can use the small test program given that guide to test whether your SCTP stack if working properly. I'll post small client-server program in SCTP in a later post.

PS: I found this SCTP library for Windows http://www.sctp.be/sctplib/, but couldn't check whether there is a support from OpenJDK-SCTP side for windows. If you find something please let me know as well.

Technorati Tags: ,,,,
 

OpenCV - Haar Training Resources

There were lot of good feed back for my OpenCV articles (Article1, Article 2). There were lot of inquires regarding Haar Training and how to do it. Since I was bit busy with my work at hSenind I couldn't put any replies for that. Finally I managed to find some time to put together few URL and important tools where you can use to create your own classifier XML.

If you are interested in OpenCV vision library you should join to OpenCV yahoo group. It is very active and has lot of resources as well.  Following are some good links I used when I was learning on how to do Haar Training with OpenCV.

Most important thing to consider when doing Haar training is to have good positive and negative image set. We have created a small utility modifying sample program provide with OpenCV to create positive samples. You can download the source here. Using that you can create positive samples to detect some object using a video. You can move frame by frame in the video using 'Space Bar', mark the areas that contain the object you want to detect using mouse and save it just by pressing 'S'. Utility will create the text file required fro training.

Utility can also be used to create sample images to be used for HMM training as well. If you are interested in HMM following http://www.bernardotti.it/portal/showthread.php?t=17777 has a good article on how to use HMM with OpenCV.

 

Refactoring Messy Code

Few days back I started to refactor some code of a project which I started few years back. Well actually I started working on that project during my second year first semester at the university. It is kind of a pet project which I started with one of my friends. When we started the project, our knowledge about best practices to be used when coding was near zero (I guess it is actually zero).

When I look back the source code of the project, it is like a hell. All possible bad practices are there in our code, very long methods (there is a one method doing some complex calculation which has more than 1350 lines :D ), code duplication, one class doing many things and the list goes on...

Well I can't blame my self for coding this kind of mess, since at that time I was just beginning my journey as a developer and didn't knew any thing about best practices. But I can't keep the code this way since it's readability is 0%; can you imagine reading a method with 1350 lines and understanding. Code has become more messy sine we have included lot of new features and requirement changes here and there. Any how we managed to deal with the code up to now, but now it is overwhelming.

Refractoring is not an easy task, we have to make sure that existing functionalities do not break as well as have to keep up with the new requirements as well.  As Martin Fowler describes in his famous book Refactoring: Improving the Design of Existing Code, there should not be any "Grand redesigns", recatoring should be an incremental process. This is going be be a good experience for me. Let's see how it goes.....

 

Craftsmanship and Ethics

This is nice presentation by Robert C. Martin posted at InfoQ. Here he talk about things that makes us professional. He talk about lot of important topics which help us to do better programming. If you are interested in programming this a going to be really really helpful for you.
In my point of view it is a MUST read for every programmer.
 

diGIT Magazine Launched


First release of the diGIT magazine was launched this month. It is a magazine dedicated for various stuff related to IT. This first release of the magazine is fairly large and rich in content ranging from introductory articles to advance stuff like Agent technology. So everyone from school children to university students can gain a lot from it.
You can view the online version of diGIT or you can download it in pdf format.
I also contributed to this magazine. My article is basically about how to start writing better code. I'm planning to write a series of articles on this topics covering various aspects of better coding practices and methods.
 

Alternative for JMS Receiver

Around 6 weeks back I was working on a project that used JMS. Application needed to receive messages through an ActiveMQ queue and then send those as SMS messages to a SMSC. This message sending happens as a batch and I needed to get batch size of messages from ActiveMQ inorder to send. I used JmsTemplate provided by Spring framework for this and used receive method to get messages from the queue.
Initially it was working fine, but later after more testing I found out that sometimes JmsTemplate's receive method do not return messages eventhough there are thousands of messages in the queue. I Googled, followed instructions given in many forum posts and ActiveMQ site with out much success.
Then one of my collegue Romith started searching source codes of some popular open source projects to see how they have used JMS receives. We were lucky... In Mule's code we found out the they have used JMS listners as a receiver. (May be mule people also have faced the same kind of problem as we were with receivers :) )
When we want to receive a message we initialise listener and get the message and then close that listener. We also developed simple class that can do the same, and it did the trick for us. Following is the simple class where we use JmsListerns to work as JmsReceiver.

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jencks.amqpool.PooledConnectionFactory;

import javax.jms.*;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

public class JMSQueueReceiverImpl implements MessageListener {

private QueueConnectionFactory queueConnectionFactory;
private Queue queue;
private QueueConnection queueConnection;
private QueueSession queueSession;
private QueueReceiver queueReceiver;
private final Object messageReceiveWaitLock = new Object();
private MessageConsumer messageConsumer;
private Log logger = LogFactory.getLog(JMSQueueReceiverImpl.class);
private List receivedMessages = new ArrayList(20);
private int requiredMessages = 0;
private int RECEIVE_ALL_TIMEOUT = 1000;
private PooledConnectionFactory pooledConnectionFactory;
private static Map> missedMessages = new Hashtable>();
private static long totalJmsMessageConsumed = 0;
private static long totalJmsMessageReceived =0;
private static long connectionCreateCount = 0;
private static long connectionCloseCount = 0;


public JMSQueueReceiverImpl(QueueConnectionFactory queueConnectionFactory, Queue queue) {
this.queueConnectionFactory = queueConnectionFactory;
this.queue = queue;
try {
if (logger.isDebugEnabled()) {
logger.debug("[" + ++connectionCreateCount + "] Creating the connection to the Queue [" + queue.toString() + "]");
}
queueConnection = (QueueConnection)pooledConnectionFactory.createConnection();
queueSession = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
messageConsumer = queueSession.createConsumer(queue);
// doStart(queue);
receiveFromCacheIfExtraMessagesFetched(this.queue.getQueueName());
} catch (JMSException e) {
if (logger.isDebugEnabled()) {
logger.debug("Error while creating the connection ", e);
}
}
}


public JMSQueueReceiverImpl(PooledConnectionFactory pooledConnectionFactory, Queue queue) {
this.pooledConnectionFactory = pooledConnectionFactory;
// this.queueConnectionFactory = queueConnectionFactory;
this.queue = queue;
try {
if (logger.isDebugEnabled()) {
logger.debug("[" + ++connectionCreateCount + "] Creating the connection to the Queue [" + queue.toString() + "]");
}
queueConnection = (QueueConnection)pooledConnectionFactory.createConnection();
queueSession = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
messageConsumer = queueSession.createConsumer(queue);
// doStart(queue);
receiveFromCacheIfExtraMessagesFetched(this.queue.getQueueName());
} catch (JMSException e) {
if (logger.isDebugEnabled()) {
logger.debug("Error while creating the connection ", e);
}
}
}

private void doStart(long timeout) throws JMSException {
messageConsumer.setMessageListener(this);
queueConnection.start();
synchronized (messageReceiveWaitLock) {
try {
messageReceiveWaitLock.wait(timeout);
} catch (InterruptedException e) {
logger.info(e);
}
}
messageConsumer.setMessageListener(null);
}

private void doStop() throws JMSException {
messageConsumer.setMessageListener(null);
//queueConnection.stop();
synchronized (messageReceiveWaitLock) {
messageReceiveWaitLock.notify();
}
if (logger.isDebugEnabled()) {
logger.debug("Message receiving finished");
}

}

public Message receive(long timeout) {
try {
requiredMessages = 1;
if (receivedMessages.size() > 0) {
if (logger.isDebugEnabled()) {
logger.debug("[pre-single] success jms receive calls [" + ++totalJmsMessageConsumed + "]");
}
return receivedMessages.remove(0);
}
doStart(timeout);
if (receivedMessages.size() > 0) {
if (logger.isDebugEnabled()) {
logger.debug("[single] success jms receive calls [" + ++totalJmsMessageConsumed + "]");
}
return receivedMessages.remove(0);
}
return null;
} catch (JMSException e) {
logger.error("Error while starting message receiving", e);
return null;
}
}

public List receive(long timeout, int messageCount) {
try {
requiredMessages = messageCount;
doStart(timeout);
totalJmsMessageConsumed += receivedMessages.size();
if (logger.isDebugEnabled()) {
logger.debug("[count] success jms receive calls [" + totalJmsMessageConsumed + "]");
}
return receivedMessages;
} catch (JMSException e) {
logger.error("Error while starting message receiving", e);
return null;
}
}

public List receiveAll(long timeout) {
try {
requiredMessages = -1;
doStart(timeout);
return receivedMessages;
} catch (JMSException e) {
logger.error("Error while starting message receiving", e);
return null;
} finally {
try {
doStop();
} catch (JMSException e) {
logger.error("Error while stopping message receving", e);
}
}
}

public void closeConnection() {
if (logger.isDebugEnabled()) {
logger.debug("[" + ++connectionCloseCount + "]Closing connection from queue [" + queue + "]");
}

try {
cacheIfExtraMessagesFetched();
try {
if(messageConsumer!= null){
messageConsumer.close();
}
} catch (JMSException e) {
logger.error("Error while stopping message receiver[consumer] ", e);
}
try {
if (queueSession != null) {
queueSession.close();
}
} catch (JMSException e) {
logger.error("Error while stopping message receiver[session] ", e);
}
queueConnection.close();
}catch (JMSException e) {
logger.error("Error while stopping message receiver[connection] ", e);
}
}

private void cacheIfExtraMessagesFetched() throws JMSException {
if (receivedMessages.size() > 0) {
if (logger.isDebugEnabled()) {
logger.debug("Extra fetched message count is [" + receivedMessages.size() + "]");
}
String queueName = queue.getQueueName();
List queueMissed = missedMessages.get(queueName);
if (queueMissed == null) {
queueMissed = new ArrayList();
missedMessages.put(queueName, queueMissed);
}
while (receivedMessages.size() > 0) {
queueMissed.add(receivedMessages.remove(0));
}
}
}

private void receiveFromCacheIfExtraMessagesFetched(String queueName) throws JMSException {
List extraMessages = missedMessages.get(queueName);
if ( (extraMessages == null) || (extraMessages.size() == 0)) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug("Extra fetched message count [" + extraMessages.size() + "]");
}
while (extraMessages.size() > 0) {
receivedMessages.add(extraMessages.remove(0));
}
}

public synchronized void onMessage(Message message) {
try {
if (logger.isDebugEnabled()) {
logger.debug("[" + ++totalJmsMessageReceived + "] Jms message received jms-correlation-id[" + message.getJMSCorrelationID() + "]");
}
receivedMessages.add(message);
message.acknowledge();
if (receivedMessages.size() >= requiredMessages) {
if (logger.isDebugEnabled()) {
logger.debug("all messages had been received ");
}
try {
doStop();
} catch (JMSException e) {
logger.error("Error while stopping message receiving", e);
}
try {
Thread.sleep(5);
} catch (InterruptedException e) {
//
}
}
} catch (JMSException e) {
logger.error("Error while acknowledging ", e);
}
}

public void setRECEIVE_ALL_TIMEOUT(int RECEIVE_ALL_TIMEOUT) {
this.RECEIVE_ALL_TIMEOUT = RECEIVE_ALL_TIMEOUT;
}


/* public static void main(String[] args) {
BasicConfigurator.configure();

// PropertyConfigurator propertyConfigurator = new PropertyConfigurator();
// Logger logger = Logger.getLogger("sample");
// LoggerRepository loggerRepository = new Hierarchy(logger);
// propertyConfigurator.doConfigure("log4j.properties", loggerRepository);

org.apache.activemq.ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
PooledConnectionFactory pool = new PooledConnectionFactory();
factory.setBrokerURL("failover://(tcp://localhost:61616?connectionTimeout=1000&soTimeout=1000&wireFormat.maxInactivityDuration=1000&wireFormat.tightEncodingEnabled=false)?initialReconnectDelay=100");
pool.setConnectionFactory(factory);






Thread thread1 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("recharge.subscriber.response"))); thread1.start();
Thread thread2 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("transfer.sender.agent.response"))); thread2.start();
Thread thread3 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("recharge.agent.response"))); thread3.start();
Thread thread4 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("sap.reversedeposit.sms.queue"))); thread4.start();
Thread thread5 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("transfer.receiver.agent.response"))); thread5.start();
Thread thread6 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("checkreloads.agent.response"))); thread6.start();
Thread thread7 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("changepin.agent.response"))); thread7.start();
Thread thread8 = new Thread(new MessageReceiver(pool, new ActiveMQQueue("sap.deposit.sms.queue"))); thread8.start();

}

private static class MessageReceiver implements Runnable {
PooledConnectionFactory pool;
ActiveMQQueue activeMQQueue;
WaitLock waitLock;


private MessageReceiver(PooledConnectionFactory pool, ActiveMQQueue activeMQQueue) {
this.pool = pool;
this.activeMQQueue = activeMQQueue;
waitLock = new WaitLock();
}

public void run() {

for (int i =0; i < 100; i++) {
JMSQueueReceiverImpl listener = new JMSQueueReceiverImpl(pool, activeMQQueue);

for (int j =0; j < 20; j++) {
listener.receive(10);
}
listener.closeConnection();
try {
synchronized (waitLock) {
waitLock.wait(200);
}
} catch (InterruptedException e) {
e.printStackTrace(); //todo implement the method
}
}

}

private class WaitLock {
private WaitLock() {
}
}

}*/
}

We have used Jencks ActiveMQ connection pool here. You can download if from codehaus here.


, , ,

 

OpenXava - Easiest way to create DB driven websites in Java

If you are a someone interested in computer programming, at some point of time you may have created a DB driven website. If you have done that you may know how difficult it is to create even a small website. Even with code generation facilities provided by IDEs and ORM tools like Hibernate you have to do quite a lot to get your web app running.
This is where OpenXava (OX) comes in handy. It is really easy to create DB driven web app using this framework. With OX to create Db driven web app only thing you have to do is to define your business entities. Yes, that is the only thing you have to do, and OX will create you nice AJAX driven website with all CRUD operations implemented and also with reporting capabilities with PDF and Excel. It is amazing right....

How much time do you think will take to create above simple web app?, an hour... Actually it only took me 10 minutes to create it with all those features, what I did was implemented simple pojo class Customer and everything else was done by OX.
OX provides you lot of customization capabilities as well. So I think this is a good time saver tool.
Download OX from here and see for your self....
 

Wishing you a Very Happy New Year


Wish you all a very happy new year.
May all your dreams come true in this wonderful year....
 

2009 Sri Lankan Holidays List

Year 2008 has almost came to an end. This is the best time to get started to welcome new year. As with last year I created a List of Sri Lankan holidays, which you can add to Outlook, Thunderbird or Google calendar.

Outlook Holiday List

– – – – – – – – – Start Copy – – – – – – – – –
[Sri Lanka] 26
Duruthu Full Moon Poya Day(BPM),2009/1/10
Tamil Thai Pongal Day(BPM),2009/1/14
National Day(BPM),2009/2/4
Navam Full Moon Poya Day(BPM),2009/2/9
Mahasivarathri Day(BP),2009/2/23
Medin Full Moon Poya Day(BPM),2009/3/10
Milad-Un-Nabi (Holy Prophet’s Birthday)(BPM),2009/3/10
Bak Full Moon Poya Day(BPM),2009/4/9
Good Friday(BP),2009/4/10
Day Prior to Sinhala & Tamil New Year Day(BPM),2009/4/13
Sinhala & Tamil New Year Day(BPM),2009/4/14
May Day(BPM),2009/5/1
Vesak Full Moon Poya Day(BPM),2009/5/8
Day following Vesak Full Moon Poya Day(BPM),2009/5/9
Poson Full Moon Poya Day(BPM),2009/6/7
Esala Full Moon Poya Day(BPM),2009/7/6
Nikini Full Moon Poya Day(BPM),2009/8/5
Binara Full Moon Poya Day(BPM),2009/9/4
Id-Ul-Fitr (Ramazan Festival Day)(BP),2009/9/21
Vap Full Moon Poya Day(BPM),2009/10/3
Deepavali Festival Day(BP),2009/10/17
Il Full Moon Poya Day(BPM),2009/11/2
Id-Ul-Alha (Hadji Festival Day)(BP),2009/11/28
Unduvap Full Moon Poya Day(BPM),2009/12/1
Christmas Day(BPM),2009/12/25
Duruthu Full Moon Poya Day(BPM),2009/12/31
– – – – – – End Copy – – – – – – –

Please follow the instructions given in one of my previous posts to add holidays list to Outlook.
Note: If you have last year’s list under Sri Lanka you will need to replace it with this year’s ones


Google Calendar


Just click on the link to add the Holiday Calendar to your Google calendar.
http://www.google.com/calendar/render?cid=trbsm3c2ek1f1l3500qr4muejs@group.calendar.google.com


Thunderbird

In order to add calendar to Thunderbird you have to have Lightning add-on installed. Follow the instructions given here if you haven't installed Lightning yet.

After installation go to Calendar view. and select Calendar -> New Calendar from main menu. From the Create New Calendar window select >On the Network, click >Next, select >Google Calendar as the format and insert the following URL into the >Location field. http://www.google.com/calendar/ical/trbsm3c2ek1f1l3500qr4muejs%40group.calendar.google.com/public/basic.ics
Click >Next, eventually enter your Google >User Name and >Password and click >OK, >Name your calendar, give it a >Color, click >Next and finally >Finish to complete the procedure.


Hope this will help you.....
 

Solving Spring Schema not found issue

Few weeks back when we were testing a Mobicents application I came across a strange error from Spring.


Warning parsing XML: XML InputStream(68) schema_reference.4: Failed to
read schema document 'http://www.springframework.org/schema/beans/spring-beans-2.0.xsd',
because 1) could not find the document;
2) the document could not be read;
3) the root element of the document is not .


Application was working fine few hours before and I was wondering what could be the error. Later I found out that this error comes because I've unpluged the network cable, application worked fine when I plugged it back. It was seems to be that Spring is trying to download schemas from internet rather than using files in classpath. This was a serious issue because machines at production site do not have internet access.

After few hours of searching we found out that a way to tell spring to get schemas from class path rather than downloading. Just give classpath:schema location in Spring xml context file in the opening declaration instead of giving url http://www.springframework.org/schema/beans/spring-beans-2.5.xsd.


<beans schemalocation="http://www.springframework.org/schema/beans
classpath:org/springframework/beans/factory/xml/spring-beans-2.5.xsd"
xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans">

</beans>
 

Extending Nautilus with Scripts

Nautilus is the default file browser we get with Gnome. Today I found out about wonderful feature of it. We can very easily extend Nautilus functionalities by adding our own custom scripts.  These scripts can be any executable file like shell script, python script or even C/C++ program.  You only have copy your scripts to
~/.gnome2/nautilus-scripts
We can get information such as current directory path, selected files using environmental variables set by Nautilus. Full set of variables are as follows.
  • NAUTILUS_SCRIPT_SELECTED_FILE_PATHS -lists the paths of the currently selected files, separated by newlines. Works only on local filesystem.
  • NAUTILUS_SCRIPT_SELECTED_URIS - contains the URIs (file://file) of the selected files, separated by newlines. Works on both local and remote filesystems.
  • NAUTILUS_SCRIPT_CURRENT_URI - contains the URI of the current directory. Works for both local and remote filesystems.
  • NAUTILUS_SCRIPT_WINDOW_GEOMETRY -provides the window location and geometry of the browser window.
Nautilus also passes list of selected files as args to your script.  So we can use them to do what ever processing we want to do.

This is a simple script that will prompt all selected files in a message box.

#!/bin/bash
#Author: M.A.C.Sandarenu http://sandarenu.blogspot.com
for arg
do
fileList="${fileList}${arg}, "
done
zenity --info  --text="You have selected following file(s) ""$fileList"
 

CrossOver Rocks.....

I managed to grab a copy of CodeWeaver's CossOver software using their 28th October promotion campaign. For those who don't know about CodeWeaver, they are the people behind the FOSS project wine which enables users to run windows applicaiton on their Linux boxes. CrossOver is commercial counterpart of the wine. The gave away $70 worth CrossOver Professional version for free on 28 Oct as a pomotion.

I Installed Microsoft Office 2007 on my Fedora 9 box using CrossOver and it works fine. I managed to install Word, Excel and Powepoint, but had problems with installing Visio.

Unfortunately CodeWeaver's aren't going to do this kind of promotions in near future. So you'll have to use Wine if you didn't managed to grab a copy on 28th Oct.










 

I'm Back after some time.....

During last few days I was unable to do any blogging simply because I was too busy with my work at hSenid. I just started my first job at hSenid 1st of October and It was really wonderful. On the first day itself I was put in to a really challenging project. I had to learn lot of new technologies such as JSLEE, SMPP, JMS, JMX, AOP and so on...
I'd learnt lot of new things and I'll hopping to share with you all as I get some free time :)
 

HTML Signatures for Your Favorite Webmail Services

Today I got to know about wonderful Firefox add-on called WiseStamp. It allows you to add nice HTML signatures to popular webmail services like Gmail, Yahoo, Live mail and AOL mail. This was a add-on I waited for long time. Some time ago I used Greasemonkey script to add HTML signature for Gmail. Now with WiseStamp I can use common set of signatures for all my webmail accounts.

Give it a try, You'll love it.
 

7 Years of Excellence - Faculty of Information Technology, University of Moratuwa

[Press release from FIT anniversary celebration committee]
 
The Faculty of Information Technology (FIT), University of Moratuwa which was established in year 2001 is the only faculty of its kind, producing pioneers to the ever growing IT industry in Sri Lanka. With the rapid growth and expansion of the information technology, FIT provides immense service to the nation by creating highly skilled IT professionals to bridge the gap between the demand and supply of IT personnel in the industry.

Despite the lack of adequate resources, both physical and human, the Faculty commenced its academic activities with a batch of 47 students in 2002. Its first home was a rented facility at Borella. The intake was increased to 100 in 2005 in response to the steadily increasing demand by the IT industry and also to provide more opportunities in this field to the talented youth of the country.

Though a fledgling faculty, FIT started its first postgraduate program in IT in 2004 with the PG Diploma/M.Sc. in Information Technology. In August 2008, the Faculty launched another postgraduate program, the PG Diploma/M. Sc in Artificial Intelligence (AI). This is the first postgraduate programs of this kind in Sri Lanka. The faculty also conducts several professional development programs from time to time. The FIT will continue to develop and expand its academic programs, adapting to the ever-changing needs of the IT industry to become an entity which both the students and the industry would look up to.

A landmark in the faculty's march towards progress is the completion of the first phase of a new state of the art building complex at the University of Moratuwa premises in August 2008. To celebrate this occasion and 7 years of excellence in the field of IT education, the Faculty will hold a series of events comprising of a multi religious ceremony, a symposium and a cricket tournament, followed by an exhibition of student innovations.

An academic conference on the theme "Graduation, Entrepreneurship and Success", will be held on 27th September 2008 at the new faculty premises with the participation students, alumni, members of the staff and industry representatives. Lead by a distinguished panel of resource persons, this conference is intended to provide students with the opportunity to experience through role models and success stories, how they can make a success of their careers in many different ways after graduation. The objectives of this symposium can be further elaborated as:

  • To create a culture of entrepreneurship among the students.
  • To learn through the experience of accomplished entrepreneurs.
  • An opportunity for the students to interact with the industry leaders.
  • To create better awareness among the corporate community about the Faculty of IT.
  • To establish links with the industry to emphasize the value and recognition of the Faculty as a leading educational body.
  • To broaden the knowledge of students on new trends in the IT industry

Among the distinguished resource persons at this event will be Mr.W.K.H Wegapitiya, CEO of Laugfs Holdings Limited, Dr. Sanjiva Weerawarana, Chairman & CEO of WSO2, Mr. Mohamed Azmeer, CEO of ConceptNursery, Mr. Ramesh Shanmuganathan, Group's Chief Information Officer, John Keels Holdings, Mr. Harsha Purasinghe, CEO of Microimage (Pvt) Ltd and Peter De Almeida, CEO of e-nable (Pvt) Ltd.


The event will conclude with a get-together at which all students past and present, will come together to celebrate the inauguration of the Faculty's new home. They will be joined by the industry representatives to create an enthralling atmosphere of celebration and entertainment.
 

Error on launching Tomcat from Eclipse in Fedora 9

Last few days I was doing some self learning on Servlets and JSP.  After doing few examples using Text Editor, I wanted to see how to create dynamic website using Eclipse; my favourite IDE. I followed the instructions given in a article in IBM site. But when I try to start the Tomcat server from Eclipse I got an strange error.

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory



I didn't have a clue about this error. As usual Google save my day. I found this post regarding the same error by Greg Johnson.

In order to solve this problem you have to download the Apache commons 1.1.1 and copy commons-logging-api-1.1.1.jar to /usr/share/tomcat/bin folder.  After copping that jar I was able to start Tomcat from Eclipse without any issue.

Thanks Greg, you save my day :)
 

End of a Beginning....

graduate

It seems yesterday that I first walked into the university, yet 4 and 1/2 years have passed. Exams of my final semester at university finished yesterday :)

It was a wonderful 4 1/2 years at FIT. I take this moment to Thank all academic, non-academic staff and my batch mates at Faculty of Information Technology, University of Moratuwa for guidance and support they gave me during all these years.

Next step of my journey begins 1st of October as a Software Engineer at hSenid....