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. 
 

Sunday, June 7, 2015

Mixed media hike plog

Today was my first sand hike at Henry Cowell State Park. The hike began through towering grove of redwood trees. One of the cut barks at the entrance of the park shows several thousand age-depicting rings, from pre-history to 1930s.  Its deeply saddening to walk in the shadows of the oldest trees under threat from erosion (because hikers don't always stay on trail) or the drought. Because of its height, the trees also seem to attract lightning, and one frequently sees a tree living strong albeit inspite of a charred interior.

We hiked past the redwood grove alongside San Lorenzo river. When Spain colonized America, a road called El Camino Real was laid all the way across the Spanish land. California falls in this region and hence everything here is named San XYZ or Santa ABC after the Catholic priest/ priestess who presided over the respective mission.
Once past this river patch, the trail sloped upwards, and was made up of sandy soil. A fellow hiker bantered why would anyone carry tonnes of sand and put it on the trail. Another countered that this is normal ocean sand, this land was a part of coastal area before it rose up by tectonic activity. This seemed plausible because California lies on the San Andreas fault. Morever one could see the gleaming ocean in the distance. The hike was billed as "easy" but it was quite challenging because of the sandy soil.

Hiking is a tool to be hopeful of the future, that no matter how reckless the humans, how destructive the forest fires, life might ultimately go on.

Wednesday, June 3, 2015

Getting hang of Android

After using iphone for 2+ years, I finally switched to Android. Here's my review. The best thing about Android is that everything one frequetly uses (read Google Maps, Gmail, youtube, Hangout) is already present on the phone. All I needed was Hangouts dialler to make calls to India, and Whatsapp and the new phone was good to go.
1. Ease of using camera: With iphone you can use +/- buttons to click a pic. I couldn't with Android. Front/ back camera selection needed to go through 2 steps. My biggest issue with this phone is I cannot access camera directly from the lock screen if I have a password lock. All of these could be a phone thing, but its something you will miss after getting used to iphone. 
2. No Back button on Chrome tab, you have to use back button on the phone. On iphone I can only open 8 tabs simultaneously, on Android I could open 10 (maybe more but havent tried it yet).
3. I couldn't send text message from my call logs.
4. Easier to turn on Cellular data.
5. Surprisingly Google maps was way off. Turns out that I need to turn on inbuilt GPS app for it to be more accurate. Never ever faced this issue with apple even though G-Map was a non-native app.
6. Choosing "Silent profile" is easier with iphone. Again this could be a phone thing. 
7. The best thing about Android phone, hands down, is the universal charger. I found the charging port much smaller than my old 4S, so actually I am a little worried about how well its going to hold up. But hopefully, there should be accessories to address this. A friend uses one called ibattz mojo for 4S, and I hope there's a similar product for Android phones too.
8. Clearing call logs is also a 2-click process. In the meantime my apologies to all the people I pocket dialled while still learning to operate the phone. 

Now that I am looking at a new phone, I have some gripes about both the OS's. The only time I really need to go to settings is to turn Wifi on/ off. Its a 2 step process for a simple thing.  My biggest issue is with the Google maps. My phone keeps telling me that the Maps will be more accurate if I am using Wifi. The ONLY reason one uses Maps on a phone is mobility. Where is the wifi going to come from if you are on the move? Or does the map coder expect that the user will turn on both Cellular Data and Wifi and drain the battery faster? Coders please get your act together.