Wednesday, November 18, 2015

Remote control over LAN using Pyvisa

1. Getting the IP address of the instruments
a. Setting the IP addresses yourself: Most instruments will come with a pre-set IP address. You will need to change it for security reasons, or if you have multiple instruments of the same type, or if you want your own intranet. If you are setting up the intranet, use ipconfig command/ network properties menu on Windows to get the Gateway and Subnet mask. While each device on intranet will have a different IP address, they will share the Gateway and subnet masks. If you will be assigning the IP address to the instruments, you want DHCP = OFF.
b. Read from the instrument
c. Using NI MAX
NI MAX --> My System --> Network Devices --> right click to see Create new VISA TCP/IP resource --> Auto detect of LAN instrument

I used a Chroma DC electronic load, assigned IP address etc. While I could ping it, it did not show up on the NI MAX autodetect. Turns out I needed raw socket (the instrument uses fixed port number).
NI MAX --> My System --> Network Devices --> cright click to see Create new VISA TCP/IP resource --> Manual entry of raw socket --> enter hostname==IP address, port number.

2. Creating a handle for the resource
A. Instruments that do not need a port number
Once NI MAX detected the resources, I could see them on rm.list_resources(). The address is of the type  TCPIP0::<ip_addr>::inst0::INSTR

Open the resource using:
import visa
rm = visa.ResourceManager()
 <handle_name> = rm.open_resource('TCPIP::<ip_addr>::INSTR)
Use <handle_name>.write(<command_string>) and <handle_name>.ask(<command_string>).

B. Instruments that need a fixed port number for Ethernet connection
For the Chroma Load, the address is of the type TCPIP0::<ip_addr>::<port_number>::SOCKET.
Method1: Using NI MAX
Open visa test panel
Configuration --> I/O settings  --> select termination character as per instrument requirements (else you will get timeout on read)
The user manual for Chroma asked to set the termination character to '\n' before reading/ writing to the instrument.
Next go to Input/ Output tab, and write commands. Then send read command and read returned value.
If you do not set the read termination character in NI MAX, then you can still visually read the returned data in its window, but the read operation will timeout.

Method2: Using visa
import visa
rm = visa.ResourceManager()
<handle_name> = rm.open_resource('TCPIP0::<ip_addr>::<port_number>::SOCKET)
<handle_name>.read_termination = '\n'
<handle_name>.ask('*IDN?')
u'CHROMA,63600-5,636005001078,1.61'

If you do not set the read_termination character, then you will get the following errors:
>>> ld1.ask('*IDN?')
Traceback (most recent call last):
VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.

Method3: Using socket
import socket as sock
<handle_name> = sock.socket(sock.AF_INET, sock.SOCK_STREAM)
<handle_name>.connect((<ip_addr>, <port_number>))
To send command: <handle_name>.send(<string_command_ending_with_\n>)
To read data: <handle_name>.recv(<give_a_buffer_size>)

Example:
import socket as sock
self.load = sock.socket(sock.AF_INET, sock.SOCK_STREAM)
self.load_addr = str(load_addr)
self.load.connect((self.load_addr, port_number))
self.load.send('*IDN?\n')
self.load.recv(256)

I prefer Method 2, because once read_termination is set, you can use write and ask commands normally.

References:
1. pyvisa tutorial
2.  read termination
3. socket code
4. Another socket code, with telnet (I havent tried this) 

Monday, November 16, 2015

स-ला-ते, स-ला-ना-ते

माझ्या मित्राने माझ्या घरचा दूरध्वनी क्रमांक "दीपिकेची आजी" या नावाने लिहिला होता. त्यावरून आमचे "दीपिकेची" शब्दप्रयोग बरोबर की "दीपिकाची" शब्दप्रयोग योग्य यावर चर्चा झाली. त्याच्या मताप्रमाणे आपण "सीतेचे", "कौसल्येचा", "राधेच्या" असे शब्द वापरतो तर दीपिकेची असं का म्हणू नये. त्यावर मी म्हटले की या सर्व स्त्रिया देवी  अथवा पूजनीय स्त्रिया आहेत, तर कदाचित त्यांची नावे वेगळ्या रीतीने घेतली जात असावीत. खरं तर संस्कृत ही मराठीची जननी आणि संस्कृत मध्ये देवी आणि सामान्य स्त्रियांमध्ये व्याकरणाच्या दृष्टीने भेदभाव केला जात नाही. मग मराठीत असे काही आहे का याचा शोध चालू आहे. संदर्भ म्हणून आरत्या अथवा जुनी गाणी (म्हणजे गीतकार मराठीचा/च्या खंदा माहितगार असतील असे मानून) ग्राह्य धरली जातील. लगेच मनात "मायेच्या हळव्या" गाणे आले, पण येथे माया हे मुलीचे नाव या अर्थी नसून abstract noun आहे. देवी नसलेल्या मुलीचे नाव असलेले गाणे म्हणून चटकन "अश्विनी ये ना" च आठवतंय. एरव्ही गाण्यांत प्रिये, सखे असे आपुलकीचे शब्द असलेली बरीच गाणी आढळून येतात.

बरं सारख्या अर्थाच्या शब्दांमध्ये पण दोन्ही प्रयोग दिसतात, "गंगाजल" Vs "कऱ्हेचे पाणी" म्हणजे संधी झाली तरी प्रयोग बदलतोय. "गंगेकाठी" Vs "कृष्णाकाठ" यात निव्वळ ज्या शब्दाशी संधी झाली त्या शब्दाची case बदलली तरी प्रयोग बदलतोय.

विचार करता करता लक्षात आलं की ही सापत्न वागणूक देव्यांनाच नाही तर देवांना आणि संतांना देखील लागू होते. "कबीराचे" शेले, "रामाच्या" राज्यात, "राधा कृष्णावरी भाळली".. देवांचं नाव "अ"कारांत असलं तरी त्यांना प्रत्यय लावताना त्यांच्या नावाचा "आ"कारांत होतो.

त्याहून पुढे जायचं तर हीच प्रथा आपण निर्जीव गोष्टींना देखील लागू केली आहे. दारची तुळस, मात्र दाराची कडी. एखादी गोष्ट सोपी असली की ती जणू "हातचा मळ", पण गप्प बसताना मात्र "हाताची घडी" तोंडावर बोट. थोडक्यात काय तर मनात आपुलकी असली की ती भाषेत उतरते. मग असं असेल तर मित्राने "दीपिकेची आजी" म्हणलं तर मी त्याच्या व्याकरणाच्या चुका न काढता त्याचा जिव्हाळा समजून घ्यावा हेच श्रेयस्कर.

 वाचकांनी देखील ह्या कार्यात सहाय्य करावे… मंडळ आभारी आहे :)

References:
१. स्वयंवर झाले सीतेचे, गीतरामायण
२. कबीराचे विणतो शेले कौसल्येचा राम
३. "राधा अंजिरी साडी ल्याली, रंग गुलाबी राधेच्या गाली" ही आजी गाते त्या गाण्यातली एक ओळ
४. "कऱ्हेचे पाणी", प्र.के. अत्रे
५. "गंगेकाठी घर हे अपुले", कल्पवृक्ष कन्येसाठी गाण्यातली ओळ
६. "कृष्णाकाठ", यशवंतराव चव्हाण

दीपिका विद्याधर रानडे
title (वि)भक्ती द्यावं असा मानस आहे

Saturday, November 14, 2015

Random ramblings

Some thoughts too lengthy for Facebook post and too short for their own blog entry:

A few observations about the things I like in other blogs/ articles.
1. Don't have too many pictures: These days I almost exclusively use smartphone, and something with a lot of pictures takes forever to load. And most of the times the pictures aren't even original, just something from stockpile. Yahoo is a major culprit here. I have to scroll through 10 slides to read 10 lines: Its a  major time waste.
A good article is concise, and doesn't beat around the bush.
Antithesis of the above: If its a DIY article, I like the ones which really go down to the basics. I went to a woodworking studio recently, and to put it in their words: The instruction is targeted for: "Haven't touched wood before" audience. Most of the times the readers don't know a thing about it. That's why we are reading the article in the 1st place.


An important lesson learnt - do not use Flouride based mouth rinse in the morning.. it messes up your taste buds the whole day!
A typical weekend started with waking up at Noon, and then attempts to find a restaurant close by for the brunch. I settled with a Middle eastern cuisine one and chose a grape-leaf thingy on the menu. Remember those grocery-store-wallahs who used to give a chocolate instead of returning the 25 paise? Small shops here take it to a new level - pay only cash unless the bill is > 10$. Good way to get people to eat a dessert or 2 to make it to 10$. Anyway, so this mid-day sunny walk left me n my roomy tired so it was time for a homemade limbu sarbat. Btw my roomy has never heard of a limbu sarbat before!!! So it was up to me to advertise the oh-so-great concoction. But thanks to the FMR, I could not even guess whether the white powder in that glass बरणी is sugar or not, nor could I tell whether the lemon tastes sour or not.



The founding fathers of the Indian Constitutions were aware that the American constitution asked that the head of government be native-born, yet such a clause doesn't exist in the Indian constitution.
Lol 1. Native born americans were American Indians, and none has been the US President.
Lol 2. who knows if when the US constitution was written, masses were already flowing into the US, and then it would make sense to add the clause.
Lol 3. Indian constitution can be ammended to reflect the changing times. At the time of writing the constitution, the winds of "swa-raj" were blowing, and the constitution-makers might have thought that the Indians would never again accept a foreign ruler. Possibly they under-estimated the Indian attraction for "gori chamdi", or dynasty trends.



As an active gator, I had heard of OAR, but never took it seriously till a few other Indian kids went on an OAR trip to the Carribs. I went to an OAR meeting and the next trip they were planning was to meet the rainbow people in Ocala National forest. I googled the rainbow people after returning home, and that sounded highly hippie-ish to me, plus the website "proudly" proclaimed that they have no regard for laws. (I had recently seen Martha Mary Marcy Marlene movie that time, and the commune concept freaked me out!!).  Two years later, while searching for "Things to do in Florida", I stumble upon a community that stays in tree houses. People can rent those tree houses and stay with the community for a few days to learn their way of sustainable life. While this sounds interesting, and I dream of staying in a tree house, staying with a commune and having my car parked a mile away from me scared me, and I decide to give it a pass. Fast forward two more years later, my colleague is going to the Burning Man festival and I am piqued enough to consider giving it a try in the future.

Review of Hemalkasa movie

Baba Amte is my hero. Swar Sudha shows marathi movies in California, and one of the movies I saw was Hemalkasa (Hindi version of Dr Prakash Baba Amte).

The movie starts with Nana Patekar emerging out of the river with a very CGI tiger. This might have worked if there were no other animals in the movie. But since there were 2 leopards, multiple monkeys, a bear, multiple snakes, one wonders why couldnt they have used a real leopard instead of the CGI tiger. The movie plot is Nana reminiscing about his life while he is at an award function in the US. Right from the start, the character of Mandatai Apte is portrayed as a weak-spirited, almost stupid woman. To innumerate a few instances:
1. She is checking out the hotel suite and accidently turns on a shower. While this scene is apparently in place for a romantic moment, it comes off as very misogynist. While there is a small possibility that such a thing might actually have happened in their lives, what was the point of involving it in a movie? Did they want to portray that the Amtes have been so dedicated to grassroots that they are unaware of western conveniences? If so, there were better opportunities to do that.
(Also, the hotels that I have been to, there is no way that your hand touches the shower faucet accidentally and it spurts all over you. Maybe the Amtes were put up in a ultra-futuristic hotel with highly touch-sensitive faucets?)

2. Mandatai is shown to be a Anesthesia resident when Dr Amte meets Mandatai. Infact she is so skilled in surgery that while Dr Amte is the surgery resident, Mandatai performs the surgery. Later in the movie, Mandatai asks Dr Amte to touch a child and confirm that it has fever. Then she asks him what should she do, and Dr Amte says to give the child paracetamol. Really director? Did you know that a MBBS doctor is academically trained in almost all fields of medicine?  Not only that, but the MBBS course also involves clinical residency rotations? Did you bother to fact check?

3. Dr Amtes beloved leopard is dying of snakebite and Mandatai informs Dr Amte that she injected the antivenin but the leopard is not responding to the anti-venin. Dr Amte then has to verify the quantity of anti-venin that she has injected. Sure this is something that must be regularly happening when one doctor takes over from another, but going with the overall chauvinism elsewhere in the movie, this scene did not sit well. 

In reality, the altruistic task of Dr Amtes would not have even started, let alone bear fruition without Mandatai.

4. Also talking about fact checking, in the movie they say that Dr Amte was in his last year of MBBS when Baba Amte took the younger Amtes to Hemalkasa during their medical school break. Later he gets married, and then he moves to Hemalkasa. I assumed that he had completed the last year of his MBBS in the meantime. Later in the movie, Dr Amte says government sent him a "love letter" because he is performing surgeries. Again, just for the information, the full form of MBBS is Bachelor of Medicine and bachelor of Surgery. If he indeed completed his MBBS, not only is he qualified to practise, he is also qualified to perform surgeries. It was not clear in the movie why was the government not happy about him practising.

5. In the scene when Dr Amte performs eye surgery on an old woman, he says he is required to perform the surgery because opthalmologists wont come to Hemalkasa and the woman cannot afford to go to Nagpur. Few scenes later, they show that they had atleast an occasional medical Ambulance ferrying patients between Hemalkasa and the better equipped Anandvan.

6. After a course of some years, only Dr Amte and no one else from his team can decipher the Adivasi language.

7. One of Dr Amte's accomplices starts teaching the kids. His alphabet and the words that he uses are foreign to the kids. (When, as kids, we were taught English == a language that was not our mother tongue, the inital objects were identified by pictures.) The camera pans over kids doing kiddy stuff like being unruly or picking their nose. Instead of acknowledging his incompetency at teaching, the accomplice makes a comment that the kids have no brains. Crass humour.

Nana Patekar shines in his portrayal of Dr Amte. Few scenes here and there do show that the director might be talented. For instance, after Dr Amte's beloved leopard Negal dies, the Amtes plant a tree at the spot where the leopard is buried. Nana later walks past the tree and nuzzles the tree. Another scene thoroughly enjoyed by the movie-goers in California was when Dr Amte cooks for his brother when his wife is not at home.

To summarize, the task undertaken by the Amtes is beyond doubt unparallelled. The movie could have done better justice to the Amtes.

Friday, October 30, 2015

चाकोरी

सहज गुणगुणताना गाणं मुखी आलं : नित्यानंद स्वरूपी सम दृष्टी सर्वांसाठी, दोषमुक्त आदिशक्ती माउली मुक्ताई. मागे दूरदर्शन वर मुक्ताई नामक मालिका असायची त्याचं हे द्योत-गीत. विचारांची मालिका ह्या गाण्यावरून सुरु झाली. मनात दुसरं गाणं आलं, "ज्ञानदेव बाळ माझा, सांगे गीता भगवंता". वाटलं त्या काळी कोणी चाकोरीबाहेर वागलं तर त्यालाच काय त्याच्या निष्पाप मुलांना देखील वाळीत टाकलं जायचं. आज तरी काळ कुठे बदलला आहे?

मागे facebook वरचे काही प्रसंग, केजरीवालांना डोक्यावर धरायचे दिवस होते तेव्हा सगळे जणू केजारीवालचे PR machines होते. मग त्यांनी राजीनामा दिला आणि त्यांच्यावरची जनतेची छत्रछायाच उडाली. मग पप्पू ची खिल्ली उडवायचे सुदिन आले, आणि चुकून एखादं काँग्रेस च सत्कृत्य कोणी चारचौघात उच्चारलं तर त्याची facebook वर अगदी टर उडवली जात असे. काही दिवस होत नाहीत तोच काही देशात इतरत्र राहणाऱ्या ईशान्य भागातल्या भारतीयांचा जीव ते बाकी भारतीयांसारखे दिसत नाहीत म्हणून लोकांनी मेटाकुटीस आणला. एवढं कमी होतं की काय म्हणून माझ्या सुधारकांच्या महाराष्ट्र राज्यात भर दिवसा नरेंद्र दाभोलकरांची हत्या होते. का तर म्हणे अंधश्रद्धेला हात घातला तर लोकांची श्रद्धा डळमळीत होते.

संगणक घरोघरी पोचल्यापासून लोकांना virtual  bullying करायला आयतं साधन मिळालंय. आता कोणी एखादी अप्रिय comment केली तर हमखास एक तरी comment "आधी नीट इंग्रजी लिहायला शिक मग इथे बोल" या आशयाची असते. कोणाला जर इंग्रजी येत नसेल तर काय मत व्यक्त करायची त्याची लायकी नाहीये?

"People unlike us" ना कमी लेखायचं आपण अगदी बालवयापासूनच शिकलोय. मी अहमदनगर हून पुण्यात आले, तेव्हा शाळेतली बाकी मुलं KG पासून एकत्र होती आणि त्यांच्यासाठी मी "outsider" होते. काही वर्षांनी माऊ शाळेत नव्याने आली तेव्हा तिला आमच्यापेक्षा जास्त चांगलं संस्कृत येतं एवढ्या एका कारणानी तिला ओळखतही नसताना तिच्यावर आगाऊपणा च label लावणाऱ्यात मी देखील होते. शाळेत माझ्यानंतर एक वर्षाने, आणि माऊआधी एक वर्ष आलेल्या दुसऱ्या मुलीने आमचं parochial वागणं आम्हाला दाखवून दिलं तेव्हा कुठे आम्ही काहीतरी चुकीचं वागतोय हे तरी आमच्या लक्षात आलं. नशीबाने  स्वतःची चूक समजण्याइतके समजूतदार होतो म्हणून आज माऊ माझी जिवाभावाची सखी आहे.

Weird for you might be regular for someone else. लहानपणी रात्रीच्या जेवणात भात अगदी गरमागरम, नुकताच शिजवलेला असायचा. इतका गरम की बोटांना चटके बसायचे आणि चमच्यानी खाण्याची घरी तऱ्हा नव्हती.  तेव्हा मी स्वत:पुरतं solution म्हणून पोळीच्या तुकड्याने भात कालावायचे आणि मग तो पोळी-तुकडा  भातासोबतच खायचे. घरी कोणी पाहुणा आला की माझा तर उद्धार व्हायचाच पण आईचा पण व्हायचा. त्या सर्व लोकांना खास burrito खाऊ घालायची माझी जाम इच्छा आहे. (ज्यांना माहित नाही त्यांच्यासाठी: burrito हा mexican खाद्यपदार्थ आहे, ज्यात पोळी च्या गुंडाळीत भात, वाटणे आणि भाज्या भरलेल्या असतात)
पण मी कितीही प्रेमाने त्यांना burrito दिला तरी त्यांनी खायला पाहिजे न!! We are highly resistant to change! मागे मैत्रिण तिच्या घरच्यांसोबत conducted tour ला US ला आली होती, तिथे अख्ख्या trip भर ते लोक फक्त भारतीय खानावळीत जेवत होते! USA ला melting pot म्हणायचं मात्र तरी vietnamese वेगळ्या enclave मध्ये राहणार तर chinese त्यांच्या chinatown मध्ये.

बरं फक्त चार चौघांसारखं असणं एवढा एकच निकष असता तर रंग उजळवणाऱ्या लेपांचा धंदा भारतात इतका तुफान का चालतो? यात पुन्हा छुप्या bullying चा दर्प येतो. आपल्यावर राज्य करणाऱ्याचा रंग काळा असता तर कदाचित आज आपल्याकडे तोंड काळं करणाऱ्या लेपांची चलती असती. मी जसा पोळी भात खाल्ला तसा कोणी ताज च्या chef ने नवा पदार्थ म्हणून काढला असता तर माझ्या समस्त नातेवाईकांनी त्याचं "पूर्णान्न" म्हणून कौतुक केलं असतं.

On death and dying

A Jain friend of mine posted on facebook about his grandfather choosing death after a fulfilling life through Santhara, aka religious fasting unto death. I was quite surprised reading his post because India considers suicide as a cognizible offense. However, from the friend's post it seemed like by undertaking Santhara, his grandfather was regarded as a saint, the Santhara a public event and there were relatives posting about the Santhara in the terms of "darshan ka labh leve".

My colleague lost his young niece to cancer 3 years ago. He participated in a fundraising run, the proceeds of which go towards research to find a cure for neuroblastoma (the type of cancer his niece died of). I recently read a blog by the niece's mom, which detailed all the rounds of chemotherapy the little child had to undergo, till finally it was time to let go.

Another colleague had to put down his dog. She developed a tumour which caused internal hemorrhage. Their options were surgery and letting her go. They chose the latter because greyhounds have very low body fat to be anesthetized. My colleague said that the dog had a good life, she only had 2 hours of suffering in her 13 years of life.

Humans are supposed to be rational beings. Secretly everyone hopes for a quick, painfree death with little burden on their caregivers. Why do we have such a hard time in delinking hope and suffering?  Atul Gawande says that most healthcare goes to terminal patients, and that too in last two months of their lives when the medicines are of little help. A vet has no qualms about suggesting that a beloved dog be put down, then why are doctors so sure about their ability to play God?

Then there was this Amish girl, whose parents decided to stop chemotherapy, so that they can make her death as painfree as possible. The hospital and the courts found this incomprehensible and are prosecuting the family. The family argues that there was a high chance of the cancer relapsing. Of course this is a decision that a doctor can take the best, but one often finds that the doctors are not upfront about all the pros and cons and treatment options.

Conversely, I read another blog, this time by an adult dying of cancer. He was a Professor of Psychology, and he chose when and how to schedule the chemotherapy which would leave him fatigued,  so that he could take time off with his wife, and live his remaining life to the fullest. He very clearly differentiates quality of life Vs quantity of life. His choice was quality, but his doctors or family wanted to prolong the quantity. Just because he was an adult, and how to end his life was his own decision; his dying wish was considered valid enough that he was not hounded by the judiciary.But the law gets murky when the patient is not a legal adult, or is senile, or is in a vegetative state. An excellent plot about a patient who wants to let go but her mom isn't allowing her to , Proceedings of appeal on behalf of Aruna Shanbaug

In the case of my friend's grandfather, the days leading upto death was a celebration of his joyous life, and his passing considered spiritual and peaceful. Death is supreme and inevitable, and its high time judiciaries, doctors, patients and their family stop fearing it. Afterall to a well organized mind, death is but the next adventure.


Sunday, October 18, 2015

Fall colours trip

Pre-script: I took 8GB worth of photos (basically filled up iphone's memory card) in this trip. You have been warned about the length of this plog.

Though India has an Autumn season, I haven't seen leaves turning red during my stay in India. During my last Fall colours trip to Colorado, PB raved about Vermont Fall colours, he advertised that even the grass turns red in Vermont. So this fall, when I had to choose between Colorado, Blue Ridge Parkway or New England, I chose New England. A week was spent in mad planning about what hikes to go to, what routes to take etc. The earlier plan was to do a roundtrip from Boston. A friend from FC, AL studies in Penn State and said while Boston is too far for her to join, she can join me in the NYC area. Thankfully my ticket was via NYC and I decided to ditch the NYC to Boston part of the ticket and rent the car from NYC instead.

Day1: I Love NYwebsite predicted peak fall colours in Catskills and Delaware water gap area. AL and I decided that we will hike in Hudson Valley area, and then I can proceed to Catskills, and she can catch the metro back to NYC. I chose Bear Mountain area, and Anthony's nose hike based upon Bing's cover photo of Fall colours seen from Bear Mountain. AL had prints of the directions to the trailhead and description of the hike, both of which were very useful. She also had thoughtfully packed sandwiches from home.
Bear Mountain and Hudson River as seen from Anthony's Nose trail

Bridge on Hudson River at Beacon, NY
First hint of Fall colours after crossing Hudson River
I carried on alongside the Hudson till Beacon, crossed over the Beacon bridge to join the freeway to go to Catskills. The plan was to take the ski ride at Hunterr Mountain, see the Kaaterskill falls and proceed to Albany. But it was already sunset by the time I reached near the Katskills. Except for the extreme traffic in NYC and a minor fall over a smooth rock at Kaaterskills the day went hitch-free.
I met an elderly couple from Long Island while I was walking from the Kaaterskills parking to the falls. They thought I was going to hike up the falls and they basically freaked out because it was well past sunset. They waited at the parking till I came back to make sure I was safe. Kudos guys (I should have noted your names but I forgot them :( )

Day2: Somewhere in Troy, NY
Road through Green Mountain National Forest, VT
had to stop to photograph this beauty
The dogs at the farmhouse near this sign were extremely agitated as I stepped out to click the pic. I guess roadtrips are so common in the US that no one stops to click pic of entering a new state anymore!!
Bennington Battle monument

View from the top of the battle monument
Covered bridges are a speciality of Vermont, a bridge very close to the Bennington Battle monument

One of the points on Mount equinox road
Panorama from Mount Equinox summit
Getting little better at taking panorama
A private house on Mount Equinox road
The road behind the private house
near Londonderry, VT
A ranch near Londonderry, VT
By now I am getting addicted of clicking a white house surrounded by Fall foliage
A mill operating on visitor donations
Day2: Overpriced side trip to Mount Equinox. The road was very steep, wonder how driving in Spiti would be like!! A ski lift at Londonderry which I didnt stop at. The famed Vermont route 100. Another side trip to another ski area which appeared closed. Post sunset meandering over super windy roads. Scary but I survived!! Too tired for Day 3, might need a vacation from this vacation.

Day3: Tired, but excited to see the Kancamagus highway. Stop1 at Franconia State park, and ride to the top in aerial tram. Resplendent fall colors at Flume Gorge parking, but by that time I was running late and had to skip the Gorge. Driving from Lincoln NH to Conway NH on the Kancamagus highway. Mapquest takes me through another scenic road to get to jam packed I95. My approximate map.
I was nearly regretting driving all the way to Franconia when I saw this, and this considerably brightened my mood

Another mill on the river

The aforementioned stream
The 2 mountains between which the Franconia notch exists
The view from the aerial tramway
The mountains awashed in colors and the freeway I-93
Panorama from Cannon Mt
The aerial tram atop Cannon Mt
The Basin, Franconia Notch State Park
Parking lot for Flume Gorge
Parking lot for Flume Gorge 2


On the short trail to the bridge


Playing music to the winds



Sabbaday falls picnic area

A piece of paradise on route 153
Post script/ Observations/ Conclusions: The fall colors photos you see on the internet are most likely photoshopped. Or people just take photo of leaves from one brightly coloured tree. Colours pop out more when there's sun shining bright and clear. One more thing off the bucket list. 

Saturday, August 15, 2015

My numistimatic inventory

My friend KC introduced me to her collection of quarters. She told me that each state had different designs for the quarters. Somehow till she pointed that out, I had never noticed that.
We needed quarters to use the washer dryer in my new apartment, and thus started my own collection. I frequently had to dig into my collection, if I was short of quarters and had started noticing which quarters are usually found aplenty, and which are somewhat rare.

All the quarters picturize something unique about the states. In days without internet, this could have been a great idea to promote tourism.

As I now sit down to form an inventory, I notice that all the quarters have " E.pluribus unum" inscribed on them.

1. unknown state: Olympic ? flame surrounded by halo of stars.
2. Denali Alaska: big horn sheep in a backdrop of mountains
3. Alaska, 1959, A bear eating fish, the great land
4. Arizona 1912, Grand canyon state
5. Arkansas 1836: crops, diamond, bird
6. American Samoa: a drum, Samoa muamua le atua
7.Great Sand dunes, Colorado
8. Colorado 1875, Colorful Colorado, backdrop of Aspen
9. Florida 1845: Gateway to discovery: Ship, plane and palms
10. Everglades Florida, couple of cranes but no aligator!!
11. Georgia 1788: Wisdom, justice, moderation: a mango-like fruit
12. Hawaii 1959: Ua mau ke ea oka aina ika pono: warrior
13. Idaho 1890: eagle esto perpetua: state map with a star in bottom-left corner of the state map
14. Iowa 1846: Grant Wood, Foundation in Education, a house and a woman holding hand of a child
15. Indiana 1816: Crossroads of America: State map with a go-kart surrounded by a halo of stars
16. Kentucky 1792: My old kentucky home: horse inside a fence, backdrop of a house
17. Fort McHenry, Maryland: house with the US flag and couple of fireworks
18. Maryland 1788, The Old line state, capitol with design of leaves along the bottom of the coin
19. Acadia,Maine: A lighthouse and house on top of a cliff, and ocean to its left
20. Maine 1820, Another lighthouse on a cliff, this time ocean on the right with a ship in the ocean
21. Michigan 1837: Great Lakes State, map of michigan
22. Minnesota 1858, Map that says Land of 10K lakes, lake with a duck, a boat, with trees alongside
23. Mississippi 1817, the magnolia state, 2 magnolias
24. Missouri 1821 Corps od Discovery canoe under arch, 1804 + 2004 along the arch
25. Glacier Montana, bison?or some yak-like animal, with a backdrop of mountain


26. Montana 1889, Big sky country, bison head
27. Great Basin Nevada, a big tree
28. Chaco Culture, New Mexico, couple of wells, backdrop of fort-like houses
29. New Mexico 1912, Land of Enchantment, flag-like/ cross-like thing
30. New Hampshire 1788, Live free or die, Old man of the mountain
31. White mountain New Hampshire
32. New York 1788, Gateway to freedom, Statue of Liberty
33. North Carloina 1789, First Flight, first plane with a person in front
34. North Dakota 1889 grazing cattle
35. Northern Mariana Islands, lighthouse ocean, sailboat, 2 birds
36. Perry's Victory, Ohio victory pillor with the Perry guy
37.Ohio 1803 birthplace of aviation pioneers, first flight + astronaut, backdrop of state map
38. Oklahoma 1907 long-tailed bird
39. Oregon 1859, Crater lake
40. Puerto Rico, Isla del Encanto, stone lighthouse with its reflection in ocean, flower
41. Rhode Islands 1790, The Ocean State, the ocean a sail and a causeway
42. South Carolina 1788, The Palmetto State, a bird and palm, backdrop of state map
43. South Dakota 1889, Mount Rushmore and a pheonix-like bird
44. Mount Rushmore closeup, South Dakota
45. Texas 1845, the Lone Star State, texas map with a star
46. Utah 1896, Crossroads of the West, railway with lighthouse and backdrop of mountains
47. Arches Utah
48. Virginia 1788, Jamestown 1607-2007 Quadricentennial, ships
49. Shenandoah Virginia, hiker on mountains
50. Washington 1889, The evergreen state, fish and Mount Rainier
51. West Virginia 1863, New River Gorge


Tuesday, June 30, 2015

Freedom of choice

The Declaration of American Independence states that "All men are created equal." For a country that states this on the founding document of its existence sure took a lot of time to extend the equality to people of colour, women and more recently LGBT people.

It is not important whether or not the LGBT people are born this way. What is more important that they have the fundamental right to live in peace, to not be discriminated against. How can you judge today's society by what was the law 2000 years ago. Your religion tells you to stone people who committed adultery. With changing time you realize the barbarity of the act. Then how do you fail to see that denying someone services, not letting them rent houses in your community, not providing them employment is any less abusive than stoning someone?

Do you think whether the marriage was legal or not stopped anyone from being with the person they wanted to be? I strongly believe that all human beings should have a freedom to act in whatever way they want to act till it is not violating others rights. If someone is LGBT, and wishes to marry another consenting adult LGBT, then who are you to decide whether they should marry or not? The role of law is to support the vulnerable so that their rights are not trampled upon. It totally makes sense to put a age of consent because kids are not mature enough, and they can be subjugated by people of authority. The role of a pastor in the wedding is to ask whether the person agrees to take the other as their lawfully wedded spouse. It is to ensure that someone is not being coerced into marrying the other. Secondly, if the sole purpose of marriage according to religion is procreation, then what about childless couples? Is their marriage any less loving?

You cite the judgement of Sodom as the sole justification of your bigotry. How can you be so sure that the people of Sodom were not punished because they were intimidating, bullying and attempting to violate the guests? Why is the gender of the guests important? Do you believe that the judgement would be any different if the guests were women who were being harassed by a mob of men? Do you actually mean that gang rape of women by men is acceptable by your religion, but gang rape of men results in destruction of the town?

If 2 people want to stay together in joy and sorrow, and in sickness and in health, let our narrow-minded interpretation of religion not do them apart. 

Friday, June 26, 2015

Hot air balloon festival

Ever since I saw photos of the Albuquerque balloon festival in one of the airlines magazines, I wanted to visit one. Plus I have an photo op idea inspired by the Disney movie "Tangled", photo of a couple facing each other with the backdrop of the balloons. So when Sonoma county was hosting one at a drivable distance, I was bound to go. The only hitch: the place was 2 hours away, and the main balloon launch was at 6.30 am. It was a 2 day event and we chose to go on Sunday. I was excited to see Saturday's balloon photos from the event's facebook page. Unfortunately, they cancelled the launch on Sunday for weather reasons, so all we could do was wait in a extremely long queue for tethered ride, and go up a teeny tiny height in a balloon.

Double unfortunately the balloon I chose to stand in the queue for was going up the least distance amongst the 3 available ones.  Tethered ride means that the balloons were tied down (by cars). They could only go up as much as the tether rope allowed for. Needless to say, the queue was longest for the balloon that was going the highest. On my part, I tried making a suggestion to the balloon "pilot" to bring the car a bit closer to the balloon, or to loosen the turns of the rope (aka elongate the tether distance), but was told that they could not do it because they didn't want the "fins" of the balloon to bang against other balloons. The pilot was nice enough to tell us about how to lower the balloon. There was another rope tied to the topmost point of the balloon's dome, a gradual yank gently lowers the balloon. However there still is residual hot air in the balloon, and the other volunteers on the ground had to manually pull down the basket to lower it all the way. Another simple trick they used was to let next bunch of people get in the basket before the people whose turn is up exited. All in all not bad for 10$.

Me and my roommate went up in the balloon at the centre
The best thing about the festival: Ordinarily, the baskets were quite tall so we needed stools to jump in to the basket. But, one of the baskets had a door to the side, so even people with disabilities could have easily entered that particular basket. This is one of the things I simply love about USA.

California is in a severe drought. But the vineyards were looking all green and regularly watered. Whenever anyone brings up the drought issue, climate-change-deniers point fingers at gigantic manicured lawns in Los Angeles. Sure, lawns are frivolous, but then wine isn't a basic necessity either. I don't mind people using water for agriculture, infact once upon a time California was apparently the fruit bowl of the world. I also agree that the vineyards are probably the only source of livelihood in the likes of Napa and Sonoma. Fundraising activities like this balloon festival should be lauded for efforts to add to non-wine tourism.

Thursday, June 25, 2015

Oscilloscope remote control

My supervisor suggested that we use python for remote control of equipment. This is primarily a reference for future Deepika, but I hope will also be helpful for some other engineer.
1. Download python and run its msi to download python in Windows.
2. Install pip: python get-pip.py
3. Install visa: pip install pyvisa
On Mac: I downloaded pyvisa  https://pypi.python.org/pypi/PyVISA and ran python setup.py install from terminal.
import visa will work as is. But one will need to add path to file to be imported before you can import files. 
import sys
sys.path.insert(0, '/path/to/directory')
4. Download Tekvisa and install its .exe

If the instrument is connected through Ethernet: try this
Restart the instrument to go to its Windows menu. Run ipconfig /all to get the Ethernet adapter Local Area Connection address --> ip_address.

import visa
rm = visa.ResourceManager()
scope = rm.get_instrument("USB::hex::hex::hex::INSTR")

print scope.ask('*IDN?')
scope.write('measurement:source ch1')
scope.write('measurement:type frequency')
print scope.ask('measurement:immed:value?')

scope.ask('ch2:scale?')
scope.ask('horizontal:scale?')
#change voltage scale
scope.write('ch2:scale 1.0000')
#change time scale
scope.write('horizontal:scale 1.0000E-9')
#stop
scope.write('acquire:state off')
#run
scope.write('acquire:state on')

References:
1. Video from Tektronix to get started
2. There is a minor error in the previous reference. This is how to fix it: fix
3. Programming manual
4. Useful example, and example2
5. You can use rm.list_resources() to get the identifier of the instrument. For other devices that I am connecting to, I used object_handle =  rm.open_resource(identifier). PyVisa will handle GPIB, RS232, USB and sockets.  Tutorial
6. Note that list_resources() will not give any information about instruments connected via LAN. You need to know the IP address of the instruments to start the communication. Use scope = rm.get_instrument("TCPIP::ip_addr::INSTR")
7. On one particular windows machine, the command prompt did not recognize pip as a command even after I installed pip. echo %PATH% showed no signs of pip. You can update path variable, or use doskey/ alias.
doskey pip=C:\Python<insert_version_here>\scripts\pip 
Now the command prompt found pip, understood the install option but kept looping around help menu. I downloaded pyvisa.tar.gz, used 7 zip to extract and ran python setup.py install to install pyvisa.
8. You can use ipconfig/all to get your ip address. Then ping self. Use arp -a to find other devices on the network.

Tuesday, June 16, 2015

Moving woes

Not too long ago, I wrote that moving in US is easy. I was totally wrong. इथे
विम्याशिवाय गाडी चालवता येत नाही. (असं फक्तं कागदोपत्री कायद्याच्या फुशारक्या मारण्यापुरते, कारण विमावाले "1 in every 7 drivers is uninsured" असं सांगून Uninsured Motorist coverage आपल्या माथी मारतात).

विमा बदलायला २ आठवडे बाकी असताना मी FL तून CA ला आले. सिलिकॉन valley ची  जनसंख्या एवढी अफाट की RTO ची appointment मिळण्यात एक महिना गेला. म्हणून CA ची license plate घ्यायच्या आधीच CA चा विमा घेतला गेला. विमा वाले विमा घेतल्याचं संबंधित RTO ला कळवतात, पण मला अजून CA चा परवाना मिळाला नव्हता, म्हणून त्यांनी FL च्या RTO ला कळवलं. नावाला जरी हे "United states"  असलं तरी प्रत्येक राज्याचे वेगळे कायदे. CA आणि FL चे विमाविषयक निकष वेगळे, आणि त्यातून नेमकं FL ला अपेक्षित असलेलं एक परिमाण घ्यायचं राहून गेलं. खरं तर राज्य सोडून जाताना त्या राज्याची license plate परत करायची असते. पण CA च्या RTO वाल्यांनी माझी  FL ची plate ठेऊन घेतली. (आणि ती FL ला पाठवयचं विसरले असणार !!) विमा वाले, CA RTO यांनी माझ्यासारखे अनेक cases हाताळले असतील असे समजून मी निर्धास्त राहिले. पण मधल्यामध्ये मी आता FLत राहत नाही याची FL ला काही खबर नव्हती. 

FL च्या दीड शहाण्या लोकांनी परस्पर माझा चालक परवाना रद्द केला. लगोलग माझा CA चा परवाना देखील आपोआप रद्द झाला. इतक्या काळात मी "CA ला येउन अनेक दिवस झाले तरी FL ची पाटी लावून फिरते" म्हणून तिकीट भरून आले, Oregon ला भाड्याची गाडी करून फिरून आले, सहा महिन्याने अजून एकदा नवीन विमा घेतला.. त्यावेळी माझा परवाना कोणी तपासला नाही? हेच का त्यांचं नावाजलेलं संगणकीय कर्तृत्त्व? शेवटी अजून एकदा विमा घ्यायची वेळ आली आणि भारतीय विमावाल्याने आपुलकीने माझी case पाहिली तेव्हा हा घोळ लक्षात आला. शेकडो फोन करून, प्रत्येक फोन वर अर्धा अर्धा तास त्यांचं तुणतुणं गाणं ऐकून,  शेवटी एकदा सगळं नीट झालं. हा  चार आण्याच्या घोळ निस्तरायला मला विम्यासाठी २०० रुपये अधिक पडले!

तात्पर्य: जो दुसऱ्यावरी विसंबला………

ता. क. : Quoting my Bachelor's classmate Shruti J, insurance business policy is "Reject insurance for those who might claim it..and accept for those who might never need it"

Sunday, June 14, 2015

Dragon boating

Dragon boating is a team sport of 18 rowers. Even a single out-of-sync rower can slow down the boat.  There are multiple competitions held in the US, for all age groups.

I grew up in Pune which is located at the confluence of 2 rivers - Mula and Mutha. Pune also has multiple other water bodies like Pashan Lake and multiple dams. There used to be small paddle boats for rent in a local park. However, over time parks and gardens in Pune started turning to lovers spot, and kid friendly attractions like these paddle boats, a toy train called Phulrani, a zoo called Peshawe park fell out of public favor. The trend is slowly reversing, but it did not change during my time in India. My first kayaking experience happened in the US. Recently, I tried out dragon boating in Redwood city, and Foster city in the Bay Area. The boats are launched from a local marina into the Redwood creek. Its a small creek that eventually drains into the San Francisco Bay.

Contrasting this situation with India, there are smaller streams that got cemented out for urban development. If we start publicly accessing our resources, it will be impossible for the unscrupulous builders to discretely grab resources. India already has Onam in Kerala, and the likes of Regatta held at College of Engineering Pune. Charity begins at home, and this could be a great way for schools to inculcate environmental responsibility, and smaller scale river clean up drives. The boats and the oars need not be fancy. There is almost no chance of the boat overturning in calmer waters, but nevertheless we were wearing floatation jackets.

We should be mindful that we are encroaching in the area meant for aquatic life. There's an animal species called Manatees native to Florida. Florida mandates "no wake zones" near breeding/ feeding spots of manatees so that they don't get killed by the larger boats. Because kayaks, canoes, dragon boat are smaller manual boats, they should not have an adverse effect on aquatic fauna. But I would definitely not recommend that India have bigger marinas that spoilt rich fellows with fancy speedboats can misuse. Actually I don't know what is the protocol in the U.S if a speedboat and a manual boat come dangerously close. Today when a bigger boat passed near us, we were asked to "hold the boat", aka hold on to the oars so that they act as brakes. In the past, when I was jet skiing at Key West, jet skiing was allowed only in a roped off area away from other water goers.

Some photos from my dragon boating:The property costs go up if they are close to marina and clean water body. Note that the operative word here is "clean". A clean city is a win-win for everybody. Contrast the small simple boat Vs the catamarans and sailboats nearby. 



Wednesday, June 10, 2015

Digital Design practice - 5

1. Mod-3 counter without using reset
Excitation table:
0 0 -> 0 1
0 1      1 0
1 0      0 0
1 1      0 0
D1= D1bar.D0
D0=D0bar.D1
If spuriously there is a 11 (say on turning on) it will be cleared because NS is assigned 00.

2. 1-wire communication to power the slave chip in addition to communication.

data output goes 2V to 1.5V, Vout = 1.5 V

3. 
Gate delay : What is so magical about FO4, and other stuff
Say we have to drive a load = 256 * inverter cap   (textbooks usually choose 64 for discussion, but 256 has a whole number squareroot, cuberoot, and fourth root. )
I calculated delay for following:
1. size one inverter driving this FO-128 load
2. size one inverter -> driving a larger inverter -> driving the FO-128 load
3..and so on.

N stages

Delay calculation
Simplified delay
1
Size 1 inverter
RC*(3*128 + 3)
3RC(128+1)
2
Size of stage 2 inverter = root256 = 16
3RC(16 + 1) + 3RC/16 * (256+ 16)
3RC(8root2+1) + 3RC(8root2 + 1)
= 2 * 3RC(8root2 + 1)
3
Size of stage 2 inverter = cuberoot256
Size of stage 3 inverter = square of cuberoot256
3RC(cuberoot128 + 1) +
3RC/cuberoot128(square_of_cuberoot128 + cuberoot128) +
3RC/square_of_cuberoot128(128 + square_of_cuberoot128)
3RC(cuberoot128 + 1) + 3RC (cuberoot128 + 1) + 3RC (cuberoot128+1)
= 3 * 3RC (cuberoot128 + 1)

From above calculation, we can reach a general equation
For N stages of increasing sized inverters:
Each inveryer is Nth-root-of-Cload times bigger than the previous.
Each stage delay = 3RC ( Nth root of Cload + 1)
Total delay for N stages = N * 3RC (Nth root of Cload + 1)
ln (total delay ) = ln (3RC) + ln N + 1/N * ln Cload
Taking the usual stuff about minimum delay => derivative of this = 0 at what value of N

Tuesday, June 9, 2015

Entitlement and displacement


Living in Bay Area is very expensive. I got an apartment in July. That is the time of the year when new grads enter the work scene. Rents go higher thanks to the increased demand, and sudden inflow of people with dispensable incomes. Add to the equation the fact that Google/ Facebook are some of the highest paying employers. The problem is, while the software engineers are earning astronomical salaries, a vast chunk of people still earn minimum wage. There is no way these people can cope up with the increased rents, and eventually move out of the Bay Area to the east bay. This cycle of gentrification continues unabated. What is worse that the people who are now forced to stay in east bay have to spend maybe an hour in commute every day. That is an hour of the time they would have been earning if they were still closer to their workplaces.  

A bigshot of one of the startups here wrote an article complaining about how these no-so-well-to-do people are making his experience of travelling in public transport unpleasant. Now I am not sure whether the article was supposed to be sarcastic. A lot of readers thought otherwise, and were quick to jump on the degrading morals of the too-rich-for-their-age youngsters. 

I am not defending the article here. The least a person can do is be humble, and atleast be aware it's us who are making life worse for them. It doesn’t hurt to give a tip here and there, to shop at local mom-and-pop store or the farmers market, dine at a fledgling restaurant or a food truck, and use the Caltrain. 

As a youngster, I used to wonder why they have actors playing doctors in pulse polio commercials. Why couldn't they just film the commercial with real doctors instead? I was planning to attend the casting call for a Danny Boyle's movie being shot here. The fine print mentioned difference in payscales for hobby actors Vs union actors. I figured it then that acting may be a hobby for some of us, something that you can do while you have your main source of income intact. But for some, it is their ONLY source of livelihood. It needs some age and maturity to develop empathy, and part of the process needs being able to witness how the other half of the world makes it through the day.

What strikes me odd is that our generation is being blamed. A saying in my native language goes that every time you point a finger at others 4 fingers are pointed towards you. This whole country is centred around entitlement and displacement. This country belongs to the Native Americans who are now banished to shrinking lands. So next time an American blames someone else (immigrants, outsourced work, software engineers..) for making his/ her life worse, let them not forget that they laid the groundwork for it.