Sunday, December 8, 2013

The "feature interaction" problem - potential Chrome and Android (and iPhone) issue

In traditional telephony, the Feature Interaction Problem (FIP) is a major concern when code for switches is developed, particularly as more features are added to particular subscriber lines. For example, Bob might have call forwarding from his home phone line to his office during work hours, but has Do Not Disturb enabled on his office phone line when a call arrives on his home line. This results in indeterminate treatment for the incoming call. In order to avoid these kinds of situations, wherever possible, phone companies used to implement careful priority rules for how particular features might work.

A more complete explanation is here: http://www2.research.att.com/~pamela/faq.html

While this problem might be mitigated somewhat in the context of a single phone line, it gets much more involved and difficult when multiple users or phone lines are involved (e.g. in the scenario from the previous paragraph). For instance, if Alice has both Call Waiting and Voice Mail features enabled on her line, a simple priority setting may be applied giving Alice up to 4 rings to pick up the waiting call, after which it is forwarded on to Voice Mail. Features in telephony switches are typically linked to triggers in the Call Model, so these can be set to work in a pre-defined priority order if there is risk of interaction.

There are several papers on this topic particularly from people who worked on the 5ESS and other switches from AT&T Bell Laboratories, long the premier Research laboratory in the world.

So why is the FIP an issue today? Let's see. In the context of Android applications or Chrome browser extensions, there are several unrelated applications a user is permitted to install and activate. Several of these might request and obtain user permission for various features including call treatment etc., unless the user is very careful, it is quite possible that indeterminate, or unexpected behavior might occur that might at best, reduce the user's delight with the use of the system, or at worst, make the system unbearably painful to use. Admittedly, this is less of a risk in the initial phases when the number of applications that utilize the more involved features supported by the user's device are available, but as these proliferate, the risks tend to rise.

Note one other thing here - in the older scenarios from traditional telephony, the location of the problem as well as the capacity to apply a fix here, were both centralized at the switch so the phone company could do these for you. This is no longer the case on the advanced smart phones of today. The issue is now localized to the smart end-point, and becomes something the end-user has to fix for themselves. And end-users tend to be far less savvy about these things than phone company Research staff tend to be. Besides, different end users have different applications installed, which might result in different feature interaction issues being manifest.

One way of minimizing these kinds of issues might be to design the APIs that developers can use such that these kinds of interactions are minimized by limiting access to particular application triggers (e.g. when apps are sleeping and waiting on a particular event to happen), or by forcing the end-user to define a priority order among these various applications on the phone. This would require a Feature Interaction Manager or FIM application to ship with the phone or as part of the smart phone operating system so that undesirable user scenarios do not occur, or their occurrence can be strictly limited to a small number of cases.

So is this all just an academic exercise at this point? Not in the least. There are several instances where adding too many extensions and enabling them all simultaneously in Chrome causes the browser to only display blank pages. No matter what URL you type, or what you do, you only see blank pages. This is debugged and fixed by turning off and then back on, extensions one at a time. This fixes the issue and makes the browser usable again. Lots of people report this issue (examples below).

Sometimes this is a result of rootkits or viruses: e.g. http://www.wintips.org/fix-google-chrome-blank-page-problem/, but other times it is resolved by turning off and on extensions as described above.
http://forums.androidcentral.com/google-nexus-7-tablet-2012/263547-blank-page-chrome.html

Since there is no easy way to fix this problem in the most general way (short of perhaps a FIM), perhaps more careful API design, developer education, and user population education that this problem exists, and how it might be addressed when it occurs, is a good way to proceed.

Saturday, December 7, 2013

Google Drive - problem and solution (advanced use case)

Many users have a very common complaint with using Google Drive, which goes along these lines:

I signed up for Google Drive and when I want to sync a folder that already contains files, the program complains that the directory is not empty. But I already have two hundred gigabytes of data in my C:\ABC directory and programs that use that data with that directory hard-coded in. Now if I move all my files over into the Google Drive folder as the Google program wants, I have to re-write all my directory paths in my code again. And if I don't move my programs to the Google Drive folder, Google's drive program won't sync with the cloud. Why can't Google fix this?

See for instance: http://productforums.google.com/forum/#!topic/drive/-TmjPhFSNAY

Thing is, Google doesn't need to fix this. Of course, it would be nice if Google's Drive sync program were able to sync a non-empty folder into the cloud, especially for new accounts. But you as a user are not helpless. A fairly simple remedy exists. This works for both Unix variants and Windows, but this post will cover how to solve this issue in the Windows environment. USE AT YOUR OWN RISK. This worked well for me.

The key to solving this problem is an idea called a hard-link. The way this works, if you create a hard-link from one directory A to another newly created directory B, then this creates a virtual copy of the directory A in B. In other words, C:\A and the newly created C:\B point to the same contents (namely the files and folders under C:\A), and any updates made to C:\B\abc will be reflected in C:\A and vice-versa. Hard links are also sometimes called "junctions" in Windows parlance.

Now, how to solve the problem in italics from above? Until Google fixes their Drive program to be able to sync any non-empty folder(s) into the cloud, what you can do is:

  1. backup the data you want saved into the Google Drive (C:\ABC) to an external hard drive device
  2. install Google Drive, set a location for the Google Drive folder or stick with the default proposed location
  3. move (do not copy) C:\ABC to Google Drive folder from (2) above
  4. the Google Drive program is happy with this, and starts sync'ing the files and folders to the cloud
  5. wait for the move in step 3 to complete. verify that it was completely successful. then delete (remove directory) C:\ABC.
  6. create a hard link between the Google Drive folder from (2) above, and C:\ABC. this step will only work if the C:\ABC drive was completely removed in step 5. 
  7. Google Drive will now sync all your files, and your programs that were hard coded with the C:\ABC path will continue to work.
So now we need to discuss how one might create a hard-link to a directory in Step 6 above. This is easily done as follows: 
  1. Open a command prompt as administrator (right click on your command prompt icon in the Start Menu, then pick "run as administrator"). 
  2. type in "mklink/?" in the command window and hit enter. this will show you the various options or switches you can use with this command.
  3. to create a hard link to a directory, you need to use the following syntax: "mklink <link> <target>". if there are spaces in either of your directory names, you need to use quotes around it (as usual). So for instance, here you are creating a hard-link between your target directory of "C:\Google Drive" (or whatever drive name you picked for the Google Drive, and C:\ABC (which now doesn't exist on disk anymore). So you type: mklink C:\ABC "C:\Google Drive" and hit <enter>. This creates a "junction" or hard-link.
... and you are done.


So how do you delete a hard-link? Deleting a directory hard-link is the same as deleting a directory in Windows. Simply type "rmdir C:\ABC" at a command prompt, and hit enter. Remember, you specify the link directory, not the Google Drive directory, in the command above. This way, your data still exists, just the link is removed.

Interesting links for comparison of various cloud drive services:
http://macography.net/2013/05/speed-test-dropbox-google-drive-box-skydrive-amazon-cloud-drive/
http://www.theverge.com/2012/4/24/2954960/google-drive-dropbox-skydrive-sugarsync-cloud-storage-competition

Tuesday, December 3, 2013

The Many Headed Hydra - Sci-Fi short story

This is from my novella, a work in progress...

"A soul is a reflection of Infinity's light in a finite form." -- Ancient Dharmin text

The creature with no name, one we will call Gestalt, moved across the galaxy. He was as old as time, with accumulated experience (wisdom?) and a desire to live peacefully on his own. After many aeons on a planet, he saw life develop on other rocks in the system, and decided it was time to move - space was too vast to have to live in crowded confines.

Gestalt loved hospitable zones - ooh to bask in the light of a star or two or three. And avoided black-holes like the proverbial plague, though the plague itself could do nothing to him. A narrow escape millenia ago where he lost nearly a sixth of his mass to one, left him wiser to the ways of the universe.

He hated moving "house". As first tenant in many ways, he could not comprehend why he ended up shifting when new life sprouted in his neighborhood. For a while things were usually tolerable and other life-forms left him alone. But every once in a while they would intrude on his space... and shy as he was, he would usually just take off through space for another living zone. "My space within space", he thought. And might have laughed too, but we do not know if he was capable of levity.

What is time really on a cosmic scale with no clock to measure it by? Sure, intra-atomic vibrations kept time, but "time" at that scale meant nothing to Gestalt who was as old as the idea of infinity. After traveling for "a while", he (it?) arrived at a rock on a system he deemed comfortable. Slowly rotating, with two stars for warmth, and only two other planets somewhat nearby, Gestalt felt sated and content. This was a nice corner in universe with no corners - this would be his home forever now. And so he lived... eking out sustenance from the warmth of the suns.

Gestalt was starting to feel lonely. As far as he knew, he was the only one of his kind. He knew nothing of his origins or of his purpose. But if he was life, and there was other life, maybe he could talk to it? That thought would now have warmed his heart - if he had one.

Millenia passed, and once again, he perceived life sprouting on the other two planets. This time, rather than just leave, Gestalt decided to adapt. What had he to lose? Other than the black-holes, he had not seen any entity that could hurt him in any way. A simple experiment couldn't hurt now, could it? And besides, life usually took a while to move off any one rock to get to a point where it could reach him. So time was in his favor.

Indivisible though he was, he simulated a liquid with his structure, and evolved it into a fixed number of separate anthropomorphic life-forms the likes of which he had seen on many planets before. Each of these was imbued with its own "personality", but they were all part of him really. They retained unique identities but a voluntary collective consciousness. They could share experiences with each other (and in so doing, with him), or not - as they chose. But connecting to the collective assured them sustenance even in this evolved form. Gestalt was particularly proud of his engineering free choice into the mix.

Since there was only so much of him to go around - in terms of physical material - there were a fixed number of forms on the rock. They would associate with each other at will, but if a form tired, decayed or felt hurt, he would absorb it into himself, enriching the collective consciousness with its private experiences, and "regrow" it through the stages of development he had witnessed everywhere there was life. Every freshly issued creature was born with a "veil of nescience" -- the knowledge of the collective was only gradually revealed to it -- though birth came with new vigor and energy to once again embrace and enjoy its existence to the fullest.

Gestalt let his "children" evolve - they, who used to communicate almost exclusively telepathically at first, created a language, then clothing, crude implements, then fire, more sophisticated tools, a social fabric, better and more comfortable dwellings, means of moving around the planet, ... yes, some aspects of this felt like devolution - using talk as a crude replacement for telepathy, for instance - but he convinced himself this let him more aptly mimic other life-forms he had seen before. To embrace his new reality fully, he gave it a name - Dharma... his children called themselves the Dharmins.

If one Dharmin "ate" (absorbed light and warmth for sustenance), satisfaction spread through the collective proportionately. If one rested, the collective felt refreshed. Gestalt felt he did well by them - gave them the means to eliminate want, while giving them (himself in their form) the ability to enjoy individual experiences with a modicum of privacy and detachment... and so life went on, until Dharmins became from the one, many.

They still had a collective consciousness, and telepathy, but gradually became more individual, more specialized - because they could adapt differently. Young ones were raised by the community. The Elders cared for them, guiding them in lifting the veil that for a while obscured their complete glory, while the others worked to improve society. With Gestalt's wisdom and the knowledge of the ages, they knew every nook and cranny on their rock and lived in harmony with their environment. A peaceful, genteel people ignorant of
want or war, their life was a continual renaissance.

A young Dharmin to another: "Does Gestalt really exist?"
The second answers: "Gestalt only knows."

The Dharmins mined the rock for a mineral called Kesavanium found plentiful on that planet, and built a shrine to The One Who Might Not Exist. They would call it Gestalt's Temple. Gestalt knew he had done well when he saw this monument to him, his "children" had constructed. A large three dimensional holographic inscription on a wall in the main hall of this crystal monument read: "G E S T A L T I S N O W H E R E". Make of it what you will.

A venerable, ageless form called The Sage - a true seer if there ever was one - presided over this monument, greeting fellow Dharmins that visited. He was always fully immersed in the Gestalt's being and spoke in riddles if he spoke at all. Many legends were written and ballads sung about him - legends that transcended the history on that rock.