Sikhism – story so far

Guru Nanak Dev Ji
Harimandir Sahib

Over the past one and a half years that this blog has been active, I have written more than 15 posts about Sikhism, a religious movement brought about by Guru Nanak Dev Ji. Sikhs believe in One Immortal Being, and none other.

Guru Nanak was once asked who is better: Hindu or Muslim. His answer was that if good deeds are not the way of life, both Hindu and Muslims will spend their life crying. Religion is like the saffron fruit: the color washes away easily. Your deeds are what will stay with you.

Sikhism has love for the Creation and for the Creator as a central tenet. If you do not have a heart filled with love for everyone (and not just your family), you will not be able to meet God – because he doesn’t speak Sanskrit, Arabic or Pali:

ਭਾਖਿਆ ਭਾਉ ਅਪਾਰੁ ॥
God speaks the language of Love

And:

ਸਾਚੁ ਕਹੋਂ ਸੁਨ ਲੇਹੁ ਸਭੈ ਜਿਨ ਪ੍ਰੇਮ ਕੀਓ ਤਿਨ ਹੀ ਪ੍ਰਭ ਪਾਇਓ ॥੯॥
I speak the Truth, please understand: those who will Love the Creation, only those will be successful in finding God.

The following are some of the more popular posts, and I recommend reading them in the given sequence:

Mool Mantra
Ik Onkar
Guru
Definition of a Sikh (audio)
Sikhism – a distinct religion
“God grant me a wish…”

If you liked these posts on Sikhism and Guru Nanak Dev Ji, you may want to subscribe to the Sikhism category of this blog.

Share

Performance tuning tips

Tuning

Today I will share with you a couple of tips on process performance tuning: rewriting your code to be faster.

This, for a change (contrasted with my previous posts on performance tuning), has nothing to do with Oracle or SQL: you can use these tips in any language.

When your code has been identified as having a performance issue, the first task is to go through the code with a fine toothed com from a performance perspective. Is there something that you can immediately notice and change?

After that is done, one should look at caching as one optimizing method. Caching is used in multiple domains, from web-browsing to microprocessor memory and there is no reason why your code should not benefit from it. As an example, an application had some logic to map department IDs: given a source department, it had to determine a target department. However, several different database tables needed to be consulted in a chain mode, some of which allowed ranges (e.g. for input department 1234A to 999B, have the output department as 526C). All this took substantial time, per department input. To solve the problem, we created a cache table: when the process looked up one department, it added that to the cache table (along with the corresponding output department). The next time it encountered the same input department ID, it would just pick up the value from the cache. How long to retain the cache is an important parameter, and your own requirements will need to decide that.

This can also be implemented using a Hash table (or a LoadLookup as some languages call it), rather than using a database table.

The second tip is moving the decision making earlier in the flow. For example, with one of the reports, certain rows were selected for processing in the beginning. Each row was thereafter processed one by one. At that time, part of the logic was to check some row fields and determine that this particular row did not need to be processed. This check was moved upwards, during the time of initial selection. As a result, the overall processing time went down.

Please go apply these two tips in your projects and let me know your feedback.

Share

Guru

Today is being celebrated as the day the first guru of Sikhs, Guru Nanak spread the light of His knowledge. Guru Nanak taught us to abide by the threefold principles of:

  1. kirt karo – Making an honest living through hardwork
  2. naam japo – remembering God at all times
  3. vand chako – sharing with others in need

He also taught us, through the Japuji Sahib (one of the writings) what God is, and how to worship him.

The importance of a Guru can’t be stated: there is no way to seek God without the Guru. Guru Nanak was the first one to show the divine path.

Some thoughts about the importance of the Guru:

ਪੂਜਹੁ ਰਾਮੁ ਏਕੁ ਹੀ ਦੇਵਾ ॥
ਸਾਚਾ ਨਾਵਣੁ ਗੁਰ ਕੀ ਸੇਵਾ ॥੧॥ ਰਹਾਉ ॥
Worship the One Divine Lord. Service to the Guru is the real bath (compared to bathing at religious places). (Pause)

 

ਗੁਰ ਜੈਸਾ ਨਾਹੀ ਕੋ ਦੇਵ ॥
ਜਿਸੁ ਮਸਤਕਿ ਭਾਗੁ ਸੁ ਲਾਗਾ ਸੇਵ ॥੧॥ ਰਹਾਉ ॥
There is no deity equal to the Guru. Whoever has good destiny inscribed on his forehead, applies himself to selfless service. (Pause)

 

ਸਤਿਗੁਰ ਕੈ ਹਉ ਸਦ ਬਲਿ ਜਾਇਆ ॥
ਪ੍ਰਗਟੁ ਮਾਰਗੁ ਜਿਨਿ ਕਰਿ ਦਿਖਲਾਇਆ ॥੩॥
I am forever a sacrifice to the True Guru. He has shown me the path.

 

ਜੇ ਸਉ ਚੰਦਾ ਉਗਵਹਿ ਸੂਰਜ ਚੜਹਿ ਹਜਾਰ ॥
ਏਤੇ ਚਾਨਣ ਹੋਦਿਆਂ ਗੁਰ ਬਿਨੁ ਘੋਰ ਅੰਧਾਰ ॥੨॥
If a hundred moons were to rise, and a thousand suns appeared,
even with such light, there would still be pitch darkness without the Guru (because the path of righteousness would not be visible).

The image below shows Guru Nanak resting, and a cobra providing the Guru shade from the sun. Rai Bular (the person standing on the side) is amazed to see this.

Guru Nanak
Guru Nanak
Share

Licensing and information about the blog available here.