Tuesday, October 28, 2008

10 Reasons to Celebrate Diwali

Why do we celebrate Diwali? It’s not just the festive mood in the air that makes you happy, or just that it's a good time to enjoy before the advent of winter. There are 10 mythical and historical reasons why Diwali is a great time to celebrate. And there are good reasons not just for Hindus but also for all others to celebrate this great Festival of Lights.

1.Goddess Lakshmi’s Birthday:
The Goddess of wealth, Lakshmi incarnated on the new moon day (amaavasyaa) of the Kartik month during the churning of the ocean (samudra-manthan), hence the association of Diwali with Lakshmi.

2. Vishnu Rescued Lakshmi:
On this very day (Diwali day), Lord Vishnu in his fifth incarnation as Vaman-avtaara rescued Lakshmi from the prison of King Bali and this is another reason of worshipping Ma Larkshmi on Diwali.

3. Krishna Killed Narakaasur:
On the day preceding Diwali, Lord Krishna killed the demon king Narakaasur and rescued 16,000 women from his captivity. The celebration of this freedom went on for two days including the Diwali day as a victory festival.

4. The Return of the Pandavas:
According to the great epic ‘Mahabharata’, it was ‘Kartik Amavashya’ when the Pandavas appeared from their 12 years of banishment as a result of their defeat in the hands of the Kauravas at the game of dice (gambling). The subjects who loved the Pandavas celebrated the day by lighting the earthen lamps.

5. The Victory of Rama:
According to the epic ‘Ramayana’, it was the new moon day of Kartik when Lord Ram, Ma Sita and Lakshman returned to Ayodhya after vanquishing Ravana and conquering Lanka. The citizens of Ayodhya decorated the entire city with the earthen lamps and illuminated it like never before.

6. Coronation of Vikramaditya:
One of the greatest Hindu King Vikramaditya was coroneted on the Diwali day, hence Diwali became a historical event as well.

7. Special Day for the Arya Samaj:
It was the new moon day of Kartik (Diwali day) when Maharshi Dayananda, one of the greatest reformers of Hinduism and the founder of Arya Samaj attained his nirvana.

8. Special Day for the Jains: Mahavir Tirthankar, considered to be the founder of modern Jainism also attained his nirvana on Diwali day.

9. Special Day for the Sikhs: The third Sikh Guru Amar Das institutionalized Diwali as a Red-Letter Day when all Sikhs would gather to receive the Gurus blessings. In 1577, the foundation stone of the Golden Temple at Amritsar was laid on Diwali. In 1619, the sixth Sikh Guru Hargobind, who was held by the Mughal Emperor Jahengir, was released from the Gwalior fort along with 52 kings.

10. The Pope’s Diwali Speech: In 1999, Pope John Paul II performed a special Eucharist in an Indian church where the altar was decorated with Diwali lamps, the Pope had a ‘tilak’ marked on his forehead and his speech was bristled with references to the festival of light.

11.Krishna defeating Indra: Govardhan Puja is celebrated the day after Diwali. It is the day Lord Krishna defeated Indra, the deity of thunder and rain. As per the story, Krishna saw huge preparations for the annual offering to Lord Indra and questions his father Nanda about it. He debated with the villagers about what their 'dharma' truly was. They were farmers, they should do their duty and concentrate on farming and protection of their cattle. He continued to say that all human beings should merely do their 'karma', to the best of their ability and not pray for natural phenomenon. The villagers were convinced by Krishna, and did not proceed with the special puja (prayer). Indra was then angered, and flooded the village. Krishna then lifted Mt Govardhan and held it up as protection to his people and cattle from the rain. Indra finally accepted defeat and recognized Krishna as supreme.

The six days

Diwali celebrations are spread over five days in India and all over the world. All the days except Diwali are named according to their designation in the Hindu calendar.
Diwali being festival of lights, across India people celebrate it via symbolic diyas or kandils (colorful paper lanterns) as an integral part of Diwali decorations.

1. Vasu Baras (27 Ashvin or 12 Krishna Paksha Ashvin): Baras means 12th day and vasu means cow. On this day cow and calf is worshipped.
2. Dhanatrayodashi or Dhan teras (28 Ashvin or 13 Krishna Paksha Ashvin): Dhan means "wealth" and Trayodashi means "13th day". Thus, as the name implies, this day falls on the 13th day of the second half of the lunar month. It is an auspicious day for shopping of utensils and gold.This day is also regarded as the Jayanti of God Dhanvantri who came out during the churning of the great ocean by the gods and the demons. Dhanvantri Jayanti
3. Naraka Chaturdashi (29 Ashvin or 14 Krishna Paksha Ashvin): Chaturdashi is the fourteenth day on which demon Narakasura was killed. It signifies the victory of good over evil and light over darkness (Gujarati: Kali Chaudas, Rajasthan : Roop Chaudas).
In south India, this is the actual day of festivities. Hindus wake up way before dawn as early as 2:00 in the morning, have a fragrant oil bath and wear new clothes. They light small lamps all around the house and draw elaborate kolams /rangolis outside their homes. They perform a special puja with offerings to Lord Sri Krishna or Lord Sri Vishnu, as he liberated the world from the demon Narakasura on this day. It is believed that taking a bath before sunrise, when the stars are still visible in the sky is equivalent to taking a bath in the holy Ganges. Hence, when people greet each other in the morning, they ask "Have you performed your Ganga Snaanam?".
After the puja, children burst firecrackers heralding the defeat of the demon. As this is a day of rejoicing, many will have very elaborate breakfasts and lunches and meet family and friends. In the evening, lamps are again lit and Goddess Lakshmi is worshipped and offered special dishes. This being a no moon day, many will offer special tarpana (offerings of water and sesame seeds) to their ancestors. This day is also called as Roop Chaturdashi
4. Lakshmi Puja (30 Ashvin or 15 Krishna Paksha Ashvin): Lakshmi Puja marks the most important day of Diwali celebrations in North India. Hindu homes worship Lakshmi, the goddess of wealth, and Ganesh, the God of auspicious beginnings, and then light lamps all across the streets and homes to welcome prosperity and wellbeing.
5. Govardhan Puja (1 Kartika or 1 Shukla Paksha Kartika) : Also called Annakut, is celebrated as the day Krishna defeated Indra. Lord Krishna taught people to worship nature, as mountains bring rains to earth. That was the reason to stop worshiping Indra. His was the message that we should take care of our nature. For Annakut a mountain of food is decorated symbolizing Govardhan mountain lifted by Lord Krishna. In Maharashtra it is celebrated as Padva or BaliPratipada. The day commemorates King Bali. Men present gifts to their wives on this day.
6. Bhaiduj (also Bhayyaduj, Bhaubeej or Bhayitika) (2 Kartikaor 2 Shukla Paksha Kartika): on this day, brothers and sisters meet to express their love and affection for each other (Gujarati: Bhai Bij, Bengali: Bhai Phota). Most Indian festivals bring together families, Bhaiduj brings together married sisters and brothers, and is a significant festive day for them. This festival is ancient, and pre-dates 'Raksha Bandhan' another brother-sister festival celebrated in the present day.

Thursday, October 9, 2008

Comparing ant and make build tools

First,I provide a simple overview of the two tools.


If you aren't familiar with make (wherby I mean specifically GNU Make), it is a UNIX-based tool that reads a Makefile, which is a set of targets (with dependants) that get "made" when a target is out of date. What happens when a target is "made" is entirely up to the Makefile author. Usually, this means compiling source code into object or executable code, but it could be anything, including checkout of resources from source control or creating distributable archives. What happens during a make is typically calls to various shell commands. Since make originally was a UNIX program, make was designed assuming the full range of UNIX commands.

Make is very flexible, in that you have a wide latitude to define variables, manipulate those variables and pass them to any command available on your system. A simple Makefile might look like this:

FILE_BASE = hello
gcc -o $(FILE_BASE) $(FILE_BASE).o

gcc -c $(FILE_BASE).c

Here, hello is a target, with hello.o being a dependant. hello.o is also a target itself, with hello.c as it's dependant. In most cases, make assumes that targets and dependants are files. So, in this example, if hello has an earlier modification date than hello.o, it will run the associated command (namely gcc -o hello hello.o), which creates hello and brings it up to date. So, if you had a whole slew of source files, make allows you to only recompile those that changed, not the whole tree. For more about what you can do with make, see the links at the end of the article.


ant is part of the Apache Jakarta project. Ant has a similar concept to make in terms of targets and dependants, but ant doesn't assume that targets and dependants are files by default. Ant also doesn't assume that the purpose of dependants are to bring targets up to date, it's merely a simple dependancy. Ant also makes use of built-in commands to implement targets, rather than assuming shell commands are available (although you can execute arbitrary shell commands). This makes ant run on any Java-supported platform. Many of the commands are specific to compiling or working with Java code. Since ant is written in Java, it has the added feature of running the Java compiler from within itself, which ends up making compilation quite fast. Ant relies on this fact, even, because the typical compilation target results in compiling every single java source it can find each time you run it. For users of make, this may sound horrendous, but the compilation step (for me) took the same amount of time to compile one class as it did for 50.

Ant also uses an XML-based syntax for creating the buildfiles (although it is not strict XML in the sense that a DTD for all of ant cannot easily be made, and the syntax allows for a lot more flexibility than you might expect in an XML file).

Comparison of the two Tools

I'll try to capture my thoughts in the following pros/cons table:
  • ant
    • Pros
      • Fast Compiles.
      • Easy to get up and running for compilation.
      • True platform independance.
      • Good error reporting of buildfile syntax errors.
    • Cons
      • Property value assignment very simple and inflexible.
      • Cannot create dynamic targets at build-time, making complex build tasks difficult to write.
      • Compiling every source file every time might be a problem for large systems.
      • Integration with other systems limited to Java classes or executing command line through Java.
      • Wrapping commands in "builtin tasks" exposes them to breakage when underlying tasks change.
      • Sparse documentation, not widely used
      • Use for non-Java projects not realistic without more builtin commands.
  • make
    • Pros
      • Incredibly flexible
      • Run-time dynamicism simplifies creating complex tasks
      • Powerful variable creation mechanism simplifies creating complex tasks
      • Integration with other build and deployment tools is very simple through shell commands
      • Assumes targets and dependants are files, which makes it easy to write targets that only do the work that is needed
      • Extensive documentation, developer knowledge and proven track record as industry standard build tool
      • Can be used for any type of project, even projects that mix languages and technologies.
    • Cons
      • Requires UNIX command set installed to be effective.
      • Requires some non-beginner level make coding to work effectively with Java compiler.
      • Complex Makefiles can be difficult to debug if not architected properly.
      • Typical UNIX user-unfriendly error messages increase learning curve.
      • Full system compiles are slower because of multiple javac invocations (although this could be remedied by calling ant for compiles only :)

I've also come up with the following, that I believe characterizes the situations in which ant or make are warranted:

  • Use ant if:
    • You are a single developer or one of a very small development group working a small Java-based application and you don't know make.
    • You are working on a project that will be developed or deployed on a platform other than UNIX or Windows
    • Your developers are all using their own build scripts and you need something fast and are not looking to build a large general-purpose build system
  • Use make if:
    • You know make
    • You are working on a medium to large sized project or on a project with more than a few developers.
    • You need to integrate with a variety of configuration management tools
    • You are building a medium to long-term solution for build and deployment that must handle a wide variety of tools and technologies

While ant is an interesting tool, I don't see it as a heavy-duty build tool for Java development. Furthermore, ant's overall design seems to be the opposite of make. ant tries to be all things to all people and reimplements functionality that's available and proven on UNIX. ant tries to have a command for everything. Looking at the list of builtin commands one can't help but get the feeling that ant was made by someone who did not understand make and didn't want to learn it, and slowly realized that there's a lot of functionality a build tool will need if it cannot rely on the UNIX command set. Comments on the ant homepage support this (e.g. "Makefiles are inherently evil") to an extent. make, on the other hand, is a framework for running arbitrary commands. True, make requires UNIX to be useful, but UNIX commands are available on almost all platforms where Java is being developed. Yes, make can be hard to learn, and it does have it's quirks, but it works and it works well for almost any situation. The make code to implement java compilation (ant's biggest draw, IMO) is quite simple (even if non-trival to derive). This is one time only operation. I think ant is great if you are a single developer who can't afford an IDE and don't want to mess with make. With ant, you'll be up and running quickly. For a Release Engineer or Lead Programmer on a project, though, make is a tried and tested tool that works just as well with Java as it does with C, and you know that it will do whatever you want it to do.