India-China Standoff – Checkmate – Part 1

India and China have been on a military standoff in the Doklam region and tri-junction area in the Sikkim Sector. The disagreement from China’s angle is that Indian troops entered undisputed Chinese territory and blocked their road construction. They also claim that the Doklam region is disputed between itself and Bhutan and India has no part to play in a bilateral dispute. India’s angle is not very clear to the public apart from defending the Siliguri corridor, also known as the Chicken’s neck. Arguments from both the sides, in my humble opinion, are foolish because both governments have strategic objectives. For China, building a road leading to no-where, is foolish and serves no other purpose than sending military equipment out to the front more quickly and effectively. India too, is giving unwarranted importance to the Doklam plateau because in the event of a full scale military confrontation, China would loose Doklam first due to clear advantages that the Indian military has in the region.

It is imperative we look at what the geography of this region looks like and what may or can happen in case of a full confrontation or a limited tactical confrontation.

India - China border standoff 2017
India – China border standoff 2017

The interesting bit is, that this standoff has two very distinct sides, one public, and the other private yet strategic. We will be exploring the strategic angle in this post series, because in all honesty, that is the angle government is unable to disclose publicly, yet is what it has in mind as the primary objective. Being no expert by any means on military strategy, I would still like to make a humble effort at decoding the strategic angle. Here goes the outline from India’s perspective:

  • A strong protest by India (read Prime Minister Modi) against China’s dual play – play with us or play against us – pick a camp and stick to it
  • We will block any attempts by Chinese at “Salami-Slicing” tactics
  • If we can’t have a full scale confrontation with Pakistan due to Nuclear deterrence issues, neither can China with India – hence – the checkmate
  • Force China to up the ante and explore all confrontation options – come to the realisation it can’t do much – and then get to the negotiation table to re-build the entire partnership
  • Realising a full scale confrontation will destroy India and severely damage China, tame the dragon to play along bilaterally, because China isn’t a Kamikaze state but a mature world power
  • Having a humungous trade deficit between the two countries, let China know it has the lions share to loose even in case of a limited conflict war-theatre
  • Send a message to all countries having disputes with China specially in the South China Sea, that the dragon has met it’s match in India, regardless of Chinese rhetoric about how inferior the Indian Military is in comparison to the Chinese Military
  • Exploit the negative rhetoric against China in India to push the manufacturing sector in India
  • Let China be very well reminded of how upset (and terrified) India is of the CPEC/OBOR because of the easy troop movement it allows for China en-circling India
  • Let the reverse of the above also be known that it is China that will have much to loose if India starts exploring pre-emptive blocking strategies against CPEC/OBOR

I hope to cover each of the strategic objectives in detail in subsequent posts and play out mock confrontation scenarios. Much of this has probably already happened and discussed behind closed doors on both sides, however it is not in the open or public domain.

 

And I am back!

Fellas! My blog is back after being dead for more than a year. It took me some maintenance and technical fixing to get the website back up and running. I intend to be more active with my blogging from now on, and talk about subjects that I care about from the bottom of my heart. The latest edition to my loved subjects is Artificial Intelligence (AI) and my work with a new startup called Karmaloop AI (www.karmaloop.ai)

Post your comments!

Linux Mint / Ubuntu – Beats Audio on HP Laptop

I am glad someone figured it out!! I will repost him so that all those stuck with crappy sound without Beats on their HP laptops while using Ubuntu get a breather.

Please note – if you are using Ubuntu 13.10 or above, you do not need to install hda-jack-retask separately, its a part of the alsa package. Install alsa-tools-gui in that case using the standard software manager.

Follow these steps (skip installing hda-jack-retask if Ubuntu 13.10 or higher)

OK! I figured it out! It sounds *awesome*!

Step 1: Install hda-jack-retask from here: https://launchpad.net/~diwic/+archive/hda (ppa:diwic/hda)

Step 2: Open hda-jack-retask

Step 3: Select the IDT 92HD91BXX codec (may be different on other models)

Step 4: Check the “Show unconnected pins” box (the internal speakers do not show as connected)

Step 5: Remap 0x0d (Internal Speaker, Front side) to “Internal speaker”

Step 6: Remap 0x0f (“Not connected” but is the under-display speakers) to “Internal speaker”

Step 7: Remap 0x10 (“Not connected” but is the subwoofer) to “Internal speaker (LFE)”

Step 8: Apply now, then test with your favorite audio program (some may not work due to Pulse reset, so find one that does, verify sound is coming from all speakers).

Step 9: If it works, select “Install boot override” to save the settings to apply at boot time.

Step 10: Reboot. When it comes back, you should have full sound from all speakers. Also test headphones. Plugging in headphones should disable sound from all internal speakers.

 

This worked awesome on my laptop! If you have questions just post in comments here.

Secret of the Romani People

A few years back when I used to be big on finding out about the origins of Indo-European people/community, I had learned about the gypsies tracing their roots back to India. Yesterday I stumbled upon the history of Romani people who are a part of the gypsy tribe and have lived in Europe for centuries not really knowing their place of origin. It will be surprising to a lot of readers that the Romani people have been genetically proven to be a race of the North-Middle-Indian territory but have lived across Europe for at least a 1000 years. The language they speak is very closely related to Hindustani or the Hindi language of India which is another startling fact.

What probably remains a big mystery is how did the Romanis or the Gypsys get to Europe from India? What made them forget the land they came from and what made them never make an effort to go back. It is a mystery even the Romani people may not know the answer to. Someday their history and their historic connection to India will be lost in the annals of time and it is unlikely if anyone will be interested in finding out the real reasons.

Do the Romani people consider themselves Indians and would they ever want to come back to India? Hmm interesting question and only a Romani connected to the roots can answer…

Getting your cheap Android Phone/Tablet to get detected for Debugging by Linux (Mint or Ubuntu)

Welcome to a post another road block I recently solved on the Android development saga. I got myself a cheap Android tablet (Byond Mi-1). In an effort to use it for Android Development with Linux Mint / Ubuntu, I had to get across quite a few steps other than what is normal. Lets go step by step:

  1. Figure out your Tablet’s Vendor ID – Use the lsusb command. It will dump out the details of all the USB devices connected to your machine. Usually your cheap tablet will not show up with a name on the dump, however in most likelihood it will be the last item on that list. To be sure, copy the output of the lsusb command into a text editor or spreadsheet. Then connect your Tablet with the computer and turn on Mass Storage (on the tablet). Run lsusb again and grab the dump and put it into a text editor or spreadsheet. There should be an extra line pertaining to your device. There will be an ID in the form of ID 1234:5678. 1234 will be your Vendor id. Take a note of it.
  2. Run the command:
    sudo gedit /etc/udev/rules.d/51-android.rules
    Copy paste these lines:
    SUBSYSTEM==”usb”, ATTR{idVendor}==”1234″, MODE=”0666″, GROUP=”plugdev”
    SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, ENV{PRODUCT}==”1234/*”, MODE=”0666″
    SUBSYSTEM==”usb”, SYSFS{idVendor}==”1234″, MODE=”0666″ 

    Please appropriately change 1234 to your correct device id.

  3. Run the following command to create a adb_usb.ini file in your .android folder in your home.
    sudo gedit ~/.android/adb_usb.ini
    Simply write your device id in this format:
    0x1234
    Save and exit
  4. Reboot your computer
  5. Unlock your tablet and go to settings. Find Developer Settings and switch on USB debugging. This step will depend on your Android version.
  6. Connect your tablet to the computer
  7. Get to your android sdk’s platform tools folder and run the command:
    ./adb devices
  8. If your device is listed, then yuhoo you got your cheap tablet ready for development.

Pretty cool eh!?

Laptop LCD screen brightness in Linux Mint 13 or Ubuntu 12.04

I recently set up a Linux workstation and based on my lookup on best distributions available, two came to fore: Ubuntu 12.04 and Linux Mint 13 (Maya). Ubuntu has always been a fantastic Linux distro, but as I learned Linux Mint is actually based off of Ubuntu and did a better job at being a full featured OS, I decided to get it setup on my desktop. I have been very pleased so far!
One of the issues faced was inability to control brightness of the screen. I could not do say from the keys on the keyboard and neither did system settings work. The fix was easy as I learned about it on other forums. Here is the link to fix the problem:
http://shellboy.com/linux-mint-13-on-dell-xps-15-brightness-keys-not-working.html

Android Development Beginning

Having begun learning Android development a little while back, and today I made some excellent progress. In order to get all my knowhow straight, I planned to create a simple app that would show me a list of people in a group. The list of people will be shown using a ListView control on the Android UI. The App would fetch this information from a RESTful Web Service written in ASP.NET C# on the Mono platform. I plan to use JSON as my choice of data communication format. Internally, the ASP.NET service will pull this information from a PostgreSQL Server.

Here is how I approached the task. I quickly threw in a table on my PostgreSQL installation which contained the names of people I want to show. On Monodevelop, I created a ASP.NET project with a simple ASPX page that dumps out a JSON for the list of users. To fetch the data from PostgreSQL we need a library called npgsql. Its pretty slick and gets the job done. Using standard mechanisms, I was able to pull data from the database and convert into a readable JSON.
The most important and challenging part (for me) came after this. That is, how to consume this service in my Android application. Coming from C# Windows Forms background, I am used to doing this in a line or two and if the call is small enough, I don’t even bother making it Async. But Android really wanted me to make the network call on a separate thread, and it did make sense! They enforced a good practice from the very beginning. Alright, so my quick reading led me AsyncTask<> class. I found some really nice tutorials on it’s implementation, specially this one: http://www.vogella.com/articles/AndroidPerformance/article.html
I faced an interesting situation here. I was trying to access my local ASP.NET server via a standard URL format like http://localhost:8080/ but that always threw an exception at me that the connection was refused. Then I tried browsing that URL from the Android emulator and that too failed. It took a while but it did strike me then, that localhost would be a loopback address on the emulator itself, not the host development machine. A quick search showed me that the emulator then uses the IP 10.0.2.2 for loopback on the host machine. Modifying my url to http://10.0.2.2:8080/ worked on the Android browser. Pretty sure it would run in my code as well, I ran my App, which to my not-my-surprise, threw the same exception.
Digging further over the internet, I realized I had missed a very basic step. Asking permissions on Android to use the Internet service. So all I had to do was put in a line in the Manifest file like:
The next I ran the App, and viola! it worked! But hey, that didn’t work all the way till showing it on the UI as a list. It only pulled the JSON string into the variable.
I now had to parse the JSON and appropriately get it into a Java consumable format. Gson by Google came to my rescue, which is a nice little framework for working with JSON on Java. I added references to it on my project and wrote some test code to see how it works. It was simple, clean and perfect. You use a Gson class, initialize it, and simply call the fromJson method to convert a JSON string to the desirable type.
Now came another roadblock, i.e. to bind it to the list view. The way ListView works is that it has an Adapter for it which can be of any custom implementation type. I used a standard ArrayAdapter and set it to the ListView. What kept tripping it off was the fact that the ListView would not consume the adapter on a thread other than the UI thread. Now this is pretty basic in the Windows Forms world and I should have thought the same would be true here. Solution would have to be similar as well, and as I found out, there is a very much similar method in Android called the runOnUiThread which takes a delegate, similar to the Invoke method on controls in Windows Forms. Now I gave a final run and yeah it was the Eureka moment to see everything working. Even after 6 years of programming, sometimes the smallest of achievements in new areas turns me on. Yeah to an extent that I spent this much writing about it… Though this write up is just for my own log purpose in an effort to track the development process of whatever it is that I am developing.
I am following a self imposed Agile Development methodology and am attempting to follow a Sprint cycle. Sprints are short burst of all round developments that enable us to understand the end-to-end process from the very beginning. For example, in my really silly simple project, I learned how to get PostgreSQL installed on my Linux box, how to get it working on C# in Mono and finally how to consume it on an Android App. This allowed me to do an integrated test of all three work environments that will form the major part of my upcoming days in deep development…
I will sign off now and log my next effort!

iPhone water damage causing no sound to come from the handset

Wow I never thought I would spill water on my precious iPhone 4… until yesterday when I actually did the forbidden. Like most cell phone companies, Apple doesn’t cover any water damage to the phone. The moment I spilled water on it, I reacted in about 3 seconds and wiped my iPhone dry. I pressed the home button and it seemed to light up and everything was responding ok. What I didnt notice at that time was that it wasn’t making the usual click sounds while unlocking and neither did it play tones when I pressed numeric buttons. It became apparent to me when after an hour I tried making a call to a friend and I wasn’t able to hear their voice from the handset. I switched it to the Loud Speaker mode, then I could hear my friend. Crap, I thought to myself and believed I had successfully damaged my iPhone’s earpiece.

Alright so lets do the problem-solution round:

Problem:
No sound coming from the handset’s earpiece, however loud speaker working fine

Solution:
The solution came to me from this link:
http://faithtoh.wordpress.com/2010/01/20/how-i-fixed-my-iphone-has-no-sound-problem/

What I did was to simply take a thin napkin that would absorb water and wrap it delicately over something like a toothpick. Turn off the phone and then clean the headphone jack with it and make sure the toothpick touches the very end. Ensuring that all the water was out of the headphone jack and then turning on the phone brought my sound back!!! It was like a miracle!!!

You must be wondering what does the headphone jack have to do with sound not coming from earpiece of the handset. Well my theory is, that water when gets inside the headphone jack, kind of shorts it and makes the phone believe that a headphone has been connected, hence causing the sound to not come from the handset earpiece.

If this post helps you, please yell yay!

Creation story of Rig Veda (Hinduism)

Recently I had a debate with some overtly religious people about creation stories and the Creator God. The ardent Hindu followers will instantly put across the trinity theory which has Brahma as the creator, Vishnu as the saviour and Mahesh as the destroyer. The Judeo-Christian belief system has it easier with one-God-does-all theory. The stories in both these philosophies go into very intricate details like how Brahma appeared on a lotus and began the creation of the universe and how God created the universe in 6 days and on the 7th day he rested.

In spite of these stories being fascinating in their own accord, they have never found their place with science. Quantum physicists would disagree with most of these theories and rubbish them. The scientists are completely correct in my opinion. Personally I have never understood the Creator God theory, because after solving one problem, it just creates another. Where did God come from? What is its plane of existence? Is He/She/It beyond the fabric of our space and time? If so then where? At some point logic breaks down. So I am not too convinced by either the Trinity of Hinduism or the One-God-Does-All theory. The only religion that has appealed to me in this respect is Buddhism which makes it very clear in the very beginning that it has no place for a creation theory. Very reasonably, because it doesn’t matter!

But then recently in an effort to understand creation theory in my own religion I turned to one of the oldest surviving literature in the world – the Rig Veda. The creation hymn CXXIX is a total stunner! Something which I hadn’t expected it to be.

1. THEN was not non-existent nor existent: there was no realm of air, no sky beyond it.
What covered in, and where? and what gave shelter? Was water there, unfathomed depth of water?
2 Death was not then, nor was there aught immortal: no sign was there, the day’s and night’s divider.
That One Thing, breathless, breathed by its own nature: apart from it was nothing whatsoever.
3 Darkness there was: at first concealed in darkness this All was indiscriminated chaos.
All that existed then was void and form less: by the great power of Warmth was born that Unit.
4 Thereafter rose Desire in the beginning, Desire, the primal seed and germ of Spirit.
Sages who searched with their heart’s thought discovered the existent’s kinship in the non-existent.
5 Transversely was their severing line extended: what was above it then, and what below it?
There were begetters, there were mighty forces, free action here and energy up yonder
6 Who verily knows and who can here declare it, whence it was born and whence comes this creation?
The Gods are later than this world’s production. Who knows then whence it first came into being?
7 He, the first origin of this creation, whether he formed it all or did not form it,
Whose eye controls this world in highest heaven, he verily knows it, or perhaps he knows not.

The Rig Veda clearly leaves the entire matter to questions with the exception of a few statements. What intrigues me the most is the fact that it states that Gods came after the universe was created. Most would challenge that, saying God has always existed etc. etc. But think about it, if whatever your religious texts says about what God wants, wouldn’t he be able to

The second statement it makes is that the first thing to appear was Desire, the primal seed and germ of Spirit. If it hasn’t struck you yet, its exactly in tandem with Buddhist teachings. So clearly Buddha was trying to bring the people of India back to Dharma as it should have been.

Besides the uncertain language of the entire text oscillates in uncertainty just as Quantum Physics does now…