Friday, September 20, 2013

Orlando Trip

I had not been to any long-distance trips lately.  So, my wife and I decided to go to Orlando, Florida.  I thought I would share some of my experience with all of you.


  1. Orlando's hotels cost a lot.  For example, we got a decent place to stay at Chicago for around $40.  The same in Orlando would have costed us some $100.  The place we chose was for $40 - which meant, it was below our expectations.  There were insects in the bathroom.  The AC was old - did not work as we intended it to work.  The wash basin happened to be outside the bathroom.  I personally was not satisfied.
  2. Then we went to Disney World - Hollywood Studios.  I went there expecting a lot of rides and stuff.  Unfortunately, most of the things available were shows.  The website is right - they have very little number of rides.
  3. The Island of Adventure in Universal Resort was great.  I thoroughly enjoyed it.  It had so many rides and stuff.


My recommendation:

  1. Choose a good hotel.  You must estimate the cost of your hotel to be about twice as much as what you pay in a normal place.
  2. Choose Universal for theme parks, if you need adventure.  Choose Disney World, if you dont like that much of adventure.


There are other places like Sea World, etc.  I did not go there.  So, I have no idea about those places.

Tuesday, September 10, 2013

Fight of narratives


I am mostly a passive reader in Quora.  But something kept cropping up again and again under the topic of "Tamil Nadu, India", or "Chennai, Tamil Nadu, India".  It is that why do Tamils hate North Indians.

http://www.quora.com/Chennai-Tamil-Nadu-India/Why-tamil-people-have-hatered-feelings-for-out-siders-Why-they-hate-north-indians-specially-Why-outsiders-cant-feel-homely-in-chennai-which-they-feel-in-Banglore-Mumbai-Hyderabad-and-rest-of-the-cities

http://www.quora.com/Tamil-Nadu-India/Why-do-Tamils-hate-Hindi-and-the-people-in-Tamil-Nadu-reluctant-to-learn-Hindi

I was totally surprised because I have been totally indifferent about the person's place or origin.  Most of the people who I know do not harbour any hatred for North Indians.  So, why do people ask these questions?  I had been thinking about these questions for a while now.  And these are the results of my reasoning.

India as a narrative

Traditional nations are made up of people who were almost homogeneous - almost all Germans speak German and are Christians and are white, almost all of the US is White, Christian, and speak English.  Think of it this way, there is a majority who get to frame the rules of the land and live happily - and minority fight for equal rights, and nowadays have succeeded quiet a bit.

India, on the other hand, is a minority-majority country.  The language spoken by the the largest numbers is Hindi which is a mother-tongue for just 40% of the population.  India is 80% Hindu - but there are multiple streams of Hinduism.  You can practically find all shades of skin color in India.  Ramachandra Guha, says it beautifully - India is like a salad bowl.  We have many sub-cultures living amongst us.  So, how did India manage to stay together, given there is so much of differences?

The answer, I feel, is narratives.  I come from deep-south of India.  Here, the idea of India is that we have four southern states - where we (Tamils) and other Indians live in; then there are some regions in north - where people speak Hindi - and where a few other Indians live.  The narrative in the north India is, we have a bunch of Hindi-speaking states, bordered with Hindi-speakable states.  There are a few people in the fringe regions in the South.  There is another narrative in West India (by Thackreys) - which is not gaining ground.

These narratives are very powerful.  They put the people holding the narratives at the center of Indian nation (in their minds).  Thus they feel India is "theirs".  But then, there are multiple narratives - each of which puts different peoples as the backbone of India.  So, almost all Indians live in their respective thought-bubbles - thinking that they are Indians.

Pakistan separated from India because in their narrative, they did not see India as "theirs" - so they separated.

Narrative-bust

These narratives get busted when an Indian step out into a region that does not comply to their narrative.  The way s/he reacts to narrative-bust is unique to the sub-culture that s/he belongs to.

It seems North Indians are more active on Quora than South Indians - which explains these rant-like questions about Tamils.

Thursday, September 5, 2013

How do you fade in and fade out text in Android?

I had a requirement to make text blink in my Android application.  This came in prety handy:

http://stackoverflow.com/questions/3450839/blinking-text-in-android-view

ViewFlipper is a control available in Android to flip through many controls.  Define all controls within ViewFlipper in layout.  Then call startFlipping() to make ViewFlipper flip.

Now, there is another control called ViewSwitcher.  According to Android docs - "ViewAnimator that switches between two views, and has a factory from which these views are created. You can either use the factory to create the views, or add them yourself. A ViewSwitcher can only have two child views, of which only one is shown at a time."

From what I understand, use ViewSwitcher like you would use themes.  Use ViewFlipper like movie names is displayed in http://www.marcustheatres.com/.

Tuesday, August 20, 2013

My personal Avaniavittam reminders

Avaniavittam is a festival day when we change the sacred thread (poonal).

This time, I had missed a few things and had to get ready quickly.  I thought I would keep a Things to do for my own reference next year.

Week before

  1. Make sure you have
  2. Poonal
  3. Dharbai
  4. Powthiram
  5. Black Sesame
  6. Rice
  7. Sandhyavandhanam book
  8. All mantra details - like greeshma rithu, varsha rithu etc.



Day before

  1. Materials to make vadai and payasam
  2. Vaccum clean the place
  3. Saree for wife
  4. Silk veshti
  5. Alarm



Tuesday, August 13, 2013

The Set

A common pattern in an interview is to ask for a data structure that would store a collection of items.  In Java, there are three types of objects that holds collection of data - Map, Set and List.

Here is a tip that would make sure that you choose an appropriate data type: Set should be your default choice.  A choice for a List should be based on you reasoning yourself out of using a Set.

Why?
Set has this data structure called HashSet.  It is super efficient.  Let us see this table for CURD operations.


HashSetArrayListLinkedList
C - Add to Collection
1
n
1
R - Find in Collection
1
lg n if sorted
n otherwise
n
D - Remove from Collection
1
n remove and move all elements
1 (finding will take n. but removing will be 1)

As you can see, HashSet is super-efficient in all cases.

When should I not use Set?

1. If your collection can allow duplicates
2. If you need to maintain an ordering of some kind.

Always use a Set by default.  Set is wonderful.

Android App not getting published

I created an Android App.  I followed all steps given here

I waited for almost two days.  The App did not get published.  It usually takes 5-24 hrs to get published.

Then I figured out that I had uploaded APKs under Alpha, Beta and Production.  But the App had remained in Alpha.  So, I moved the application to Production.

Here is the screenshot of the page:

Developer Console -> Your App -> APK -> Production tab -> Move to (drop-down)-> Choose Production.

Thursday, August 1, 2013

Android: Wake Up - Mistakes that I made

I had been working on a very simple Android Alarm App.  The users would set up an alarm after certain period of time.  When the time for Alarm arrives, the BroadcastReceiver defined in our application receives a signal.  If the phone is in lock mode, we have to wake the phone up and display to the user that it is time.

To wake the phone up, I am using android.os.PowerManager and PowerManager.WakeLock.

  1. I had tried waking the phone up from inside BroadcastReceiver.  It should be done from Activity's onCreate() method.
  2. The parameters that I passed for getting a new WakeLock were not working right.  In fact, I don't know which is the correct parameter I should use.  I am now using a deprecated parameter which is the only thing that is working for me.  The method is PowerManager'sInstance.newWakeLock().  The first parameter is levelAndFlags - I am using PowerManager.SCREEN_DIM_WAKE_LOCK.  I know I will have to use a combination of different non-deprecated flags.  But, I have not figured it out yet.
  3. Always release the WakeLock in onFinish(), onPause(), onStop() methods.