Month: October 2008

Working with CruiseControl-2

Another issue which took considerable amount of my time to resolve is the following.
Issue:
D:\CruiseControl\BuildServer\WorkArea\SampleCCProject\build-cc.xml:10: The following error occurred while executing this line:
D:\CruiseControl\BuildServer\WorkArea\SampleCCProject\build.xml:56: java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;ZZ)Ljava/io/File;
Resolution:

This is because of Ant and JUnit version mismatch.I was initially using Apache Ant 1.7.1 because its latest release as on date. I got rid of it by using Ant 1.6.5 with JUnit 3.8.2 ( comes with CruiseControl )

Working with CruiseControl-1

While working with CruiseControl I faced the following issue. But I could not get help from Google. Hence I am listing the issue and its resolution.

Issue:
D:\CruiseControl\BuildServer\WorkArea\SampleCCProject\build-cc.xml:10: The following error occurred while executing this line:
D:\CruiseControl\BuildServer\WorkArea\SampleCCProject\build.xml:56: Problem: failed to create task or type junit
Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.
        This looks like one of Ant’s optional components.
Action: Check that the appropriate optional JAR exists in
        -D:\CruiseControl\BuildServer\cruisecontrol-bin-2.7.3\lib
        -C:\Documents and Settings\chaita_matukumilli\.ant\lib
        -a directory added on the command line with the -lib argument
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
This is not a bug; it is a configuration problem
Resolution:
Add ant-junit.jar in lib folder of CruiseControl.
While the resolution is self explanatory to some extent it is not complete. Though it tells some jar is missing and where it needs to be added, It will not tell what jar file to add.

Python for loop

In Python, the for loop works differently.If we try to modify the loop iterator variable, it will be simply skipped and iterator will continue from its next value irrespective of the modification.

So in case if we need to modify the loop iterator value in our logic, we have to choose while loop. for loop cannot be used in this scenario. Here is the code snippet to see it in action:

for i in range(1,10):
if i==3:
i+=2
print i

Learning Python

Started learning Python using A Byte Of Python by Swaroop CH few weeks back.Started loving this programming language. It’s so simple and easy to learn.Also gathered couple of other good books from fellow Python enthusiast at work, Joe Jacob.Thank you Joe.

 

I will post any interesting information I find in Python.

Learnings at the Railway Ticket Booking Counter

During the festive times, getting train / bus tickets is getting very difficult.People are booking well in advance as soon as the bookings begin. For Indian Railways, it is 90 days before the date of journey.Everybody wants to go Home during the holidays and if the holiday comes with adjoining weekend, then the rush cant be imagined.And for poor planners and people who decide to travel in the eleventh hour, like me,will have to lose money and time as well.

I had to wake up at 4AM to be at the booking counter at 5:30 AM  which opens at 8AM only to find that there are already people who came even early.Everyday, for the past  4 days, I was at the counter by 5:30AM. But I was humbled every time and I was never the first one in the queue.But I somehow managed to get all the tickets I wanted.Thanks to my social skills. They came very handy when I was position 3 in the queue on one day.If not for them, I wouldn’t have got my ticket.

I lost lot of time and money but there is no other go. This is the next best option available.I cant travel in General bogie continuously for two days and also I cant afford Volvo whose price will only skyrocket on the day before the journey date.

These are the learnings:

[1] If you badly want something, you will somehow get it. (I woke up at 4 AM everyday for 4 days, even after losing touch with the habit of getting up early)

[2] How much ever smart you think you are, there will always be someone somewhere, who will outsmart you.So be humble. ( I went everyday at 5:30 AM thinking that I will be the first one to be in the queue. But only to find that there were already people waiting from 4 AM or even 3AM. I was never first one in the queue.)  

[3] Social and networking skills are a must for anyone. ( My ability to connect and mingle with people helped me one day to get my ticket despite of arriving at position 3. Remember that Tatkal tickets will be exhausted in no time (max 5 minutes from the start time), especially in a festive season like this.So even if you are in position 3, you will NOT get a ticket.)

[4] Think beyond yourself and help others in your little way.There is a lot of satisfaction in that.( I helped two of my friends and one more person who was behind me in the queue in getting tickets.)

Day 3

Success.

Thanks to my social skills. I could manage to go at position 2 despite of arriving at 3rd position.

Ok now what is all this about?  Will write in next post.