Message for 2017

New year 2017 is on horizon.

Everyone will enjoy firing crackers on 31st December eve around the globe. But, there is not a single message from an environmentalist yet! Otherwise, they are on full fire 15 days ahead of Diwali!

Santa Clause is a mythical character. But, people trust that story. Whereas shraaddh or kaag vaas (food offered to crows on shraddh days) is superstitious. What is in our puraaNas is mythical and superstitious.

Offering bilva leaves to mahaadeva during shraavaNa damages environment. But, cutting whole christmas trees is fine and no environmentalist is bothered at all!

Bird lovers feel sad for birds being wounded by kite flying on 14th of January. But, their sympathy is blown away in blues when people eat birds and kill birds!

Bathing in Gangaa to eradicate sins is superstitious but throwing coins in river for wishes is acceptable!

Tulasi vivaaha is superstitious but they have faith in christmas tree!

We do not oppose any religion. We want respect for our own religion and samskruti (culture)!

Finally, we pray God, touch feet of elders and share sweets to celebrate our new year whereas foreign cultures celebrate new year with alcohol!

(Translated what’s app message)


Custom syntax with vim

Custom syntax with vim – Chirag Patel August 10, 2015

On Linux, install vim if you do not have.
On Windows, install gVim (I tried 7.4).

Create vjn.vim file similar to following example.


” Vim syntax file
” Language: config file
” Maintainer: Chirag Patel

if exists(“b:current_syntax”)

:syn keyword error ERROR
:syn keyword warn WARNING

:syn keyword user chirag vrund svara parul
:syn keyword admin digant vikas hina

hi def error guibg=red guifg=white
hi def warn guibg=yellow guifg=black

hi def user guifg=’tomato1′
hi def admin guifg=’deep pink’


Check vim74/rgb.txt file to find color definitions.
Add vjn.vim to vim74/syntax folder.
Edit vim74/filetype.vim file and add following lines to alphabetical order of file types.


” Config
au BufNewFile,BufRead *.vjn setf vjn


You are all set to have fun and have interesting configuration file looks.

Also, do not forget to add following to your vim settings (_vimrc or .vimrc) for more fun.


colorscheme slate
set guifont=Courier_New:h10:cANSI
set autoindent
set ts=4
set softtabstop=4
set shiftwidth=4
set incsearch
set hlsearch
set nowrap
set noexpandtab
set showmatch
filetype on
syntax on
set ruler
set cindent
set noswapfile
set mat=5



Most innovative company CEOs 2014

Based on the list from http://www.forbes.com/innovative-companies/list/ 2014 for 100 companies, I checked CEO educational background. I could not find accurate information for some. This list is 99% accurate tho.

Here’s the spreadsheet: 150314_ceo_inno

The interesting facts from this analysis:

32 – undergraduate work in Engineering or Science
40 – undergraduate work in business, finance, accounting or marketing
4 – undergraduate work in pharmacy or medicine
15 – undergraduate work in Law, History, Philosophy etc

11 – master’s in engineering or science
36 – MBA
3 – MD

Total 41 bachelor’s, 44 master’s, 3 PhD

One more myth buster: 11 have Engineering + MBA track and 21 have Business/Accounting/Finance + MBA track.


Double precision rounding

Uses my_double_greater_check from http://rutmandal.info/eng/2014/06/double-precision-comparison-in-cc/

double my_double_round( double val, int multiplier )
         double val_adj = val * multiplier;
         if ( my_double_greater_check( val_adj – floor( val_adj ), 0.0 ) > 0 )
                      val = round( val_adj ) / multiplier;
         return val;

round and floor are C math library <math.h> functions.


double rnd_val = my_double_round( 0.000998, 1000);

rnd_val will be 0.001



Being Indian – Chirag Patel December 10, 2014

Being Indian – Chirag Patel December 10, 2014

Last week, during lunch at my office cafeteria, I was discussing Indian and Chinese cultures with some colleagues of Chinese origin. It was formal discussion from food to clothes to languages. All of a sudden, one colleague asked me, “What is it being Indian?” and wore curiosity in her black curved eyes. I paused for seconds and told myself with audible sound, “Wait a minute! That’s my religion!”

That small statement evolved ocean of thoughts into me whole day. I kept thinking and now my pen (err keyboard) collaborated with paper (computer screen, ha); so I am here to stir thoughts into your calm lake of mind.

As world knows today the country named India is derived from Indus which is Greek version of name Hindu given by Persians. Hindu is again derived from Sindhu – a river in Northern part of India. Sindhu is a Sanskrut word meaning Ocean. Sindhu is a big ocean-like river. Persians used to call the land dwellers – Hindoo. So, Indus or Hindu has geographical reference in the name. Some Arabic people call India – Hindustan which literally means place of Hindus!

That term later on being used by Britishers as the word for a religion under umbrella of which sprung hundreds of sects. So, “hindu” or for that matter “India” signifies religion. Britishers and to some extent natives used that term quite significantly to differentiate themselves from Muslims and Christians.

Ok, these are all western names or foreign names given to India. So, what would native people call this land? There was ancient emperor named Bharat who ruled majority of geographical land which is India in present times. So, this land was known as “Bharat” – land ruled by emperor Bharat! Bharat has meaning in Sanskrut as the place where people seek Brahman or God. So, name “Bharat” signifies spirituality irrespective of religion.

Constitution of India effective since 1950 January 26 officially considers two versions of name of the country – 1) Republic of India 2) Bharat. In modern India, secular India, people proudly proclaim being part of India or Hindustan. But, they ignorantly forget the name Bharat!
Now, let us take a look at harder aspect of being an Indian. We so far have glanced at the name of the country. Now, let us dare signify “being an Indian” part of it. Let us ordinary mortals sneer at the terms.

India is a country personified celestial beauty! Look at geographical rendition of Nature’s poetry! Thin neck, broad and protruding chest, long legs, open arms! When this beauty is laid on Mother Earth, she is divided in 29 states and 7 union territories. The beauty speaks in 22 official languages. Majority of states have their own official language, different cultural heritage, different clothing style, different food, and different look of habitats, different flora and fauna, different geography, different festivals. Many have different calendar systems. If you talk to two people from adjoining states, you have countless clues to find differences between them. Many a times, they seem to be from different countries. They have different dance traditions, different sculptor styles, and different architects.

An outsider is definitely at a loss to identifying common features among Indians. Do they speak the same language? No. Do they wear the same clothes traditionally? No. Do they have similar cuisine? No. Do they practice the same religious faith? No. Do they look similar? May be. Do they have the same cultural context? May be. Do they tolerate people from different states (forget countries)? I want to say YES here. But, blunt NO! I got it. They have different language. But, do they write the same script? Nooo.

What happened to that image of celestial beauty named India? So, let us explore some common factors that bind all Indians together irrespective of race(?), religion(?), gender and financial status(!).

All Indians know or speak national language Hindi and British legacy language English. All Indians follow one constitution. All Indians consider Bhagavad Gita as Holy book. All Indians consider river Ganga sacred. All Indians know Himalaya as sacred place and have high esteem for Mount Kailas. All Indians use spices or herbs in what they consume daily. All Indians have some faith in Ayurveda. All Indians know Amitabh Bachchan, Rajanikant and Sachin Tendulkar. All Indians consider Mahatma Gandhi as mentor of the nation. All Indians believe that corruption is inevitable. All Indians have a check list of places to visit. All Indians want India to be number one nation in the world. All Indians claim to have wisdom of life and would like to expand their knowledge territory to intrude into others’. All Indians know Yoga and Pranayama up to some extent and practice it knowingly or unknowingly. All Indians find root of what they speak into ancient language Sanskrut.

So, from ancient history known to the world today, concept of one land geographically known as “Bharat” existed in Indian psyche. Even tho there are 33 million Gods and Goddesses, all Indians believe in one supreme consciousness and consider these celestial forms of Gods and Goddesses as different paths leading them to Moksha or Nirvana or Mukti or union with Supreme Soul. Indians have affinity towards four vedas – Rugveda, Samaveda, Yajurveda, and Atharvaveda. Indians consider Bhagvad Gita as esteemed doctrine for religious, spiritual and daily practice. Lotus is national flower as well as spiritual emblem. Peacock and tiger also are national symbols and pride. All these concepts bind all of us Indians together. Sutre mani gana iv as Gita proclaimed – all beads inter-woven to same thread!

Can we negate the fact that Vedic culture and Hindu way of living life are real identities of India? Can all Indians following different religions value that?


Ask these to company

1. What’s the biggest change your group has gone through in the last year? Does your group feel like the tough times are over and things are getting better, or are things still pretty tough? What’s the plan to handle to either scenario?

2. If I get the job, how do I earn a “gold star” on my performance review? What are the key accomplishments you’d like to see in this role over the next year?

3. What’s your (or my future boss’) leadership style?

4. About which competitor are you most worried?

5. How does sales / operations / technology / marketing / finance work around here? (I.e., groups other than the one you’re interviewing for.)

6. What type of people are successful here? What type of people are not?

7. What’s one thing that’s key to this company’s success that somebody from outside the company wouldn’t know about?

8. How did you get your start in this industry? Why do you stay?

9. What are your group’s best and worst working relationships with other groups in the company? What are the pain points you have to deal with day-to-day?

10. What keeps you up at night? What’s your biggest worry these days?

11. What’s the timeline for making a decision on this position? When should I get back in touch with you?

12. It’s been tough economic times, and every position is precious when it comes to the budget. Why did you decide to hire somebody for this position instead of the many other roles / jobs you could have hired for? What about this position made you prioritize it over others?

13. What is your reward system? Is it a star system / team-oriented / equity-based / bonus-based / “attaboy!”-based? Why is that your reward system? What do you guys hope to get out of it, and what actually happens when you put it into practice? What are the positives and the negatives of your reward system? If you could change any one thing, what would it be?

14. What information is shared with the employees (revenues, costs, operating metrics)? Is this an “open book” shop, or do you play it closer to the vest? How is information shared? How do I get access to the information I need to be successful in this job?

15. If we are going to have a very successful year in 2016, what will that look like? What will we have done over the next 12 months to make it successful? How does this position help achieve those goals? (This question helps show your ability to look beyond today’s duties to the future more than a year away.)

16. How does the company / my future boss do performance reviews? How do I make the most of the performance review process to ensure that I’m doing the best I can for the company?

17. What is the rhythm to the work around here? Is there a time of year that it’s “all hands on deck” and we’re pulling all-nighters, or is it pretty consistent throughout the year? How about during the week / month? Is it pretty evenly spread throughout the week / month, or are there crunch days?

18. What type of industry / functional / skills-based experience and background are you looking for in the person who will fill this position? What would the “perfect” candidate look like? How do you assess my experience in comparison? What gaps do you see?

19. What is your (or my future boss’) hiring philosophy? Is it “hire the attitude / teach the skills” or are you primarily looking to add people with domain expertise first and foremost?

20. In my career, I’ve primarily enjoyed working with big / small / growing / independent / private / public / family-run companies. If that’s the case, how successful will I be at your firm?

21. Who are the heroes at your company? What characteristics do the people who are most celebrated have in common with each other? Conversely, what are the characteristics that are common to the promising people you hired, but who then flamed out and failed or left? As I’m considering whether or not I’d be successful here, how should I think about the experiences of the heroes and of the flame-outs?

(from email by Marc Cenedella)


Open – Chirag Patel July 15, 2014

Open – Chirag Patel July 15, 2014

Hugged by womb of darkness,
With gentle flow of words in melody,
Dumb-found directions witnessing,
Iota of existence started journey
towards non-duality!

Swollen red lips playing tag,
Tip of tits bloomed with beats,
Thirst of impatient body
Exploded like waves of
bees enjoying nectar!

In the midst of boat thumping,
With wand moving to meet navel,
Opened petals of lotus
With juice of life which
Allured whole cosmos in union!

Slowly rising splash of joy,
Listening to floating music of non-dual,
“Lamp” and “Light” hid existence
In the heart of time and
Lost selves!


Double precision comparison in C/C++

Checking double precision value for limits is tricky.


double x = 1.0;
if ( x == 1.0 ) do_something();


This comparison can fail as double precision value when converted to hexadecimal (what computer can do only) representation, looses some least significant bits or positions beyond double precision digits. So, in above example if ( x == 0.9999999 ) might have worked depending on compiler and/or CPU. Therefore, in programming, we create functions to check such limits to approximate values.


// Used for double type comparasion
typedef union mydouble_ {
    double dbl_val;
    unsigned long un_u32_val[2];
    unsigned char un_u8_val[8];
} mydouble;


// Checks double value against close enough limits i.e. min <= val <= max
// Return: -1 => val < min
// Return: 0 => min <= val <= max
// Return: 1 => val > max
int my_double_limit_check( double val, double min, double max )
    mydouble dbl;
    mydouble cmp;
    int ret = 0;
    if ( val < min )
        dbl.dbl_val = val;
        cmp.dbl_val = min;
        if ( dbl.un_u32_val[0] != cmp.un_u32_val[0] )
            ret = -1;
        else if ( dbl.un_u8_val[4] != cmp.un_u8_val[4] )
            ret = -1;
    if ( val > max )
        dbl.dbl_val = val;
        cmp.dbl_val = max;
        if ( dbl.un_u32_val[0] != cmp.un_u32_val[0] )
            ret = 1;
        else if ( dbl.un_u8_val[4] != cmp.un_u8_val[4] )
            ret = 1;
    return ret;
// Checks double value against close enough less value i.e. val < min
// Return: -1 => val < min
// Return: 0 => val >= min
int my_double_less_check( double val, double min )
    mydouble dbl;
    mydouble cmp;
    int ret = 0;
    if ( val < min )
        dbl.dbl_val = val;
        cmp.dbl_val = min;
        if ( dbl.un_u32_val[0] != cmp.un_u32_val[0] )
            ret = -1;
        else if ( dbl.un_u8_val[4] != cmp.un_u8_val[4] )
            ret = -1;
    return ret;
// Checks double value against close enough greater value i.e. val > max
// Return: 1 => val > max
// Return: 0 => val <= max
int my_double_greater_check( double val, double max )
    myouble dbl;
    myouble cmp;
    int ret = 0;
    if ( val > max )
        dbl.dbl_val = val;
        cmp.dbl_val = max;
        if ( dbl.un_u32_val[0] != cmp.un_u32_val[0] )
            ret = 1;
        else if ( dbl.un_u8_val[4] != cmp.un_u8_val[4] )
            ret = 1;
    return ret;
// Checks double value against close enough equal value i.e. val == eql
// Return: 0 => val == eql
// Retrun: 1 => val != eql
int my_double_equal_check( double val, double eql )
    mydouble dbl;
    mydouble cmp;
    int ret = 0;
    if ( val != eql )
        dbl.dbl_val = val;
        cmp.dbl_val = eql;
        if ( dbl.un_u32_val[0] != cmp.un_u32_val[0] )
            ret = 1;
        else if ( dbl.un_u8_val[4] != cmp.un_u8_val[4] )
            ret = 1;
    return ret;


Indians in last 100 years

List of notable scientist/mathematicians in last 100 years from India who studied in India till master’s degree and worked mostly in India to achieve their feat:

1) Mahindra Agrawal – PhD from Kanpur – AKS primality test in mathematics – worked in India only
2) Sam pitroda – masters from Vadodara – inventor of digital diary and more than 100 telecom patents – worked in USA and then India only
3) Jayant Narlikar – masters from Varanasi – steady state theory, gravity theory – worked in UK and then India only
4) V Bappu – masters from Chennai – Wilson Bappu effect, astronomical discoveries – worked in USA and then India only
5) Y subbarao – masters from Hyderabad – first tetracycline
6) Salim Ali – masters from Mumbai – ornithology (birds) – worked in India only
7) KR Rao – masters from Chennai – many inventions in nuclear physics – worked in India only
8) PC Mahalanobis – undergraduate from Kolkata – statistical theory, survey, anthropology – worked in UK and then in India only
9) GN Ramachandran – masters from Bengaluru – molecular biology, crystallography – worked in India only
10) Harish Chandra – masters from Mumbai – discrete series, philosophical aspect of mathematics – brief work in India
11) Ganapathy Thanikaimoni – masters from Chennai – fossil and modern pollen morphology – worked in India only
12) APJ Abdul Kalam – masters from Chennai – indigenous missile system – worked in India only
13) Anil Kakodkar – masters from Mumbai – Indigenous nuclear explosions, heavy water reactor – worked in India only
14) Vikram Sarabhai – masters from Bengaluru – cosmic rays – worked in India only
15) S Chandrashekhar – masters from Chennai – chadrashekhar limit, Brownian motion, sunlit sky polarization – worked in USA only
16) G Sudarshan – masters from Chennai – explained weak force, quantum optics – worked in USA mostly and some in India
17) Satyendranath Bose – masters from Kolkata – Fifth state of element (Bose-Einstein theory), black body radiation – worked in India only
18) M Visvesvaraya – masters from Bengaluru – steel doors to protect wastage of water dam – worked in India only
19) Meghnad Saha – masters from Kolkata – ionization formula, spectral line – worked in India only
20) Jagdish Chandra Bose – masters from Kolkata – wireless communication, life in plants – worked in India only
21) Homi Bhabha – masters from Mumbai – electron shower, meson discovery – worked in UK and then India only
22) CV Raman – masters from Chennai – raman effect scattering of lights – worked in India only


One Syllable Gujarati Words for Kids

કાન – kaan – Ear
આંખ – aaKh – Eye
નાક – naak – Nose
હાથ – haaTh – Hand
પગ – pag – Foot
પેટ – peT – Stomach
જીભ – jeeBh – Tongue
દાંત – daat – Tooth
વાળ – vaaL – Hair
નખ – naKh – Nail
ગાલ – gaal – Cheek
હોઠ – hoTH – Lips
ટાલ – Taal – Skull without hair

ગાય – gaay – Cow
ભૂન્ડ – BhoonD – Pig
મોર – mor – Peacock
વાઘ – vaaGh – Tiger
ભેંસ – Bhes – Buffalo
સાપ – saap – Snake
ઊંટ – ooT – Camel
હન્સ – hans – Swan

ઘાસ – Ghaas – grass
ફૂલ – fool – Flower
ઝાડ – JhaaD – Tree
છોડ – CHoD – Plant
વેલ – vel – Vine
વાંસ – vaas – Bamboo
ડાળ – DaaL – Branch
થડ – ThaD – Trunk/Stem
મૂળ – mooL – Root
પાન – paan – Leaf
ફળ – faL – Fruit
બી – bee – Seed

જો – jo – See
ખા – Khaa – Eat
ચાલ – Chaal – Walk
ચલ – Chal – Come
જા – jaa – Go
દોડ – doD – Run
હસ – has – Smile
રડ – raD – Cry
આપ – aap – Give
લે – le – Take
વાંચ – vaaCh – Read
લખ – laKh – Write
ચાખ – ChaaKh – Taste
સૂંઘ – sunGh – Smell
ગન્ધ – ganDh – Odor
વાસ – vaas – Smell
છોડ – ChoD – Leave
હા – haa – Yes
ના – naa – No
બોલ – bol – Speak
રમ – ram – Play
માર – maar – Hit
હાર – haar – Lose
જીત – jeet – Win
ભાગ – Bhaag – Run
ઊઠ – ooTH – Wake up/Stand up
બેસ – bes – Sit
ઊન્ઘ – oonGh – Sleep

મા – maa – Mom
બા – baa – Grandma

ઘર – Ghar – House
પૂલ – pool – Bridge
તોપ – top – Gun
ગામ – gaam – Village
આગ – aag – Fire

બૂટ – booT – Shoes
શર્ટ – SharT – Shirt
પેન્ટ – penT – Pant
પીન – pin – Hairpin
ફ્રોક – frok – Frock
હાર – haar – Garland

ભાત – Bhaat – Rice
ઘઉં – Ghau – Wheat
શાક – Shaak – Vegetables
શીન્ગ – Shing – Beans
દાળ – daaL – Grams
ચા – Chaa – Tea
દૂધ – dooDh – Milk
ઘી – Ghee – Clarified Butter
તેલ – tel – Oil
ગોળ – goL – Jaggery
ખાન્ડ – KhaanD – Sugar

એક – ek – One
બે – be – Two
ત્રણ – traN – Three
ચાર – Chaar – Four
પાંચ – paaCh – Five
છ – CH – Six
સાત – saat – Seven
આઠ – aaTH – Eight
નવ – nav – Nine
દશ – daSh – Ten
વીસ – vis – Twenty
ત્રીસ – tris – Thirty
સો – so – Hundred
લાખ – laaKh – 100,000