Sunday, 19 March 2017


A new vision proposed by the Prime Minister of India, Mr. Narendra Modi, in the India Today conclave, 2017, in which the new India would be all about opportunities and hard work, sets the tone just right for out of the box solutions to some persistent problems over the past century.

That the Prime Minister has announced more reforms in redundant legislative and legal practices and laws is another right step in the right direction for the BJP led government that promises the people of India for some breathtaking changes and initiatives in the near future. The existing techniques used by the human resources, administrative affairs, planning have more often than not led to more problems than resolving them.

The approach, as the Prime Minister said in his address, has to change into a more holistic one. Current planning, at least since 2000, has heavily focused and relied on the Information Technology sector to provide jobs and stabilize the employment ratio but this has caused innumerable side effects like nurturing rogue real estate manipulators, which has resulted in greedy land grabbers taking control over a region, to the effect that even the politics of the country got changed due to it but more importantly, it increased the corruption mafia's hold on many administrative matters as well as affecting the business due to the swing in favor of the greedy manipulators and the whole situation gets back to square one for the people.

To reduce the burden of employment in the IT industry, which projects 'lottery' like dreams to the education sector that there are more riches in the IT jobs than in show biz, a parallel and alternate means to earn should be made available to the people so that anyone, of any age, could do some work and earn money from the government directly, increasing the bonding of people with the country and the government, thereby reducing the scope to favor criminal ways to earn money and reducing the scope for terrorism in the country, and make way for a robust economy with a steadily improving employment ratio. The mafia mentality that ultimately shows up as a mob culture to the outside world, when activists whip up chaos in cities, is actually a product of this system of the 'controlled' and 'organized' sector of the country that has, somehow perfected, 'organized dishonesty'.

So, the agenda-based 'planning' measures and processes should be forsaken for newer approaches with a focus on a leaner approach in governance.

There are only two elements that bother the progress of the country - one, work and the other, money. With just these two elements, the approach is to provide a new model of work - earn from anywhere doing anything!

This new model of work, earn, from anywhere, for any type of work, would also reduce the burden on the government to plan for employment with uncertain data and improve the unemployment scenario in the economy plus it will greatly reduce crime as the means and opportunity to earn for everybody will be readily available.

Other advantages of such a work model are that it will enable social changes with increased, healthy interactions between the people and the various segments of governance. For instance, in India, the saddest of all social evils is the fear to help a rape victim or an accident victim even if the inclinations are right, due to the many pitfalls with hospital regulations and the police, which is, anyway, the most abhorred unit in the country. When this model of work is implemented, due to the associated evidences of work that need to be submitted for the government to approve that it is part of the category for which a payment rate is set, the transparency and the confidence that the government knows that the accident victim or the rape victim was helped by this citizen and vouched for by a witness, reducing the fear of getting framed, wrongly, by corrupt or ignorant laws or apprehending hit and run cases to do which not only is the former a great deterrent but there is no incentive either.


A government enabled/driven. powered service that would provide for means to earn money by doing any work that a citizen may want to like cleaning the street, helping an accident victim (which is the most troublesome and feared of events due to the various red tape associated with the hospitals and the police and the bribes associated with it would majorly improve public welfare because this service model will not only have everything documented and the police that there would be no possibility that the person helping an accident victim would not get harassed for doing a good job), catching some miscreant on the streets, providing food to some needy, helping an old woman or man crossing the street, fighting against over-charging auto rickshaw driver or helping a girl in distress or helping some needy and if the government cares, just about anything that is considered useful for governance.

This model would accept work done on the streets or at any place, which could be logged in by the citizen with a valid Aadhar card and attested by any other citizen that "Yes, the work for which the person is seeking compensation has been validated" with a screenshot or a mobile picture uploaded to the server for which adequate, appropriate compensation could be remitted by the government, online, directly into the work submitter's bank account or even a PayTm account.
The country has lots of problems - cleanliness, waste management, fringe elements that have no clue nor business to be in any region as they have nothing to do and this lot numbers in millions, in the country, traffic discipline, bribery as a culture in many departments of many organizations (even now, in 2017, driving license can be obtained through bribes), tax evaders at the level of employees of well paying organizations where producing and getting away with fake travel bills, fake fuel bills, undeclared income, false declarations of investments, fake rent receipts to claim HRA is all considered as the 'normal' and anyone who thinks otherwise loses their job or is targeted - and the diktat that it is the government that should handle all the problems and provide solutions is the wrong attitude and the chief cause for such blatant practices to be there in our daily, routine life. 

Tuesday, 7 February 2017

"Lazy" vs "Greedy" Design

"Convention over Configuration" always intrigued and fascinated me although I knew, deep in my heart, I did not understand a word of the trilogy of words! So, when I chanced upon this opportunity to relate two examples of design that I happened to come across (one, due to my recently, of some years, acquired liking for simplicity and two, as a user with limited resources), I chose the middle path - not to coin any new set of fancy words but to rely on the existing set of terminology doing the rounds in technical forums - "lazy" and "greedy".

The process of authentication has become far more refined and varied than it used to be in the days when WSE sounded like some Chinese royalty among peasants so, rather than go into all the intricacies of "packaged" libraries or encryptions of the Da Vinci code type, I decided to check out the OTP (One Time Password) with Time and Space as the chief factors of ensuring the authentication cycle.

The "Time", as in the 'time' that the OTP gets sent to the 'time' that the user uses the OTP and the "Space", as in the 'space' between the email window and the application window. For this form to be called a "lazy" design is not exactly correct if not contrived, but when put in relief with the other forms of authentication doing the rounds, it does have a "lazy" tinge to it even though, put to some severe test, it may break due to the space factor but the 'laziness' becomes pronounced when seen in relief with the following description of a 'design' that I found on a gateway (and possibly, that which exists, across the world!) - that of a payment gateway authenticating the OTP sent to the user by automatically picking up the OTP sent by SMS to the user's mobile and then submitting it for processing to the gateway!

There is a huge flaw in such a design that is far too greedy in its functioning and the greediness can be better perceived with an elaboration using a Context and a Domain diagram but since there is no real need for me to prove a point or score one over the application (anyway, it is my blog so what I say is always right ! :)) designers, suffice it to say that it fails a test scenario, where the network or the network signal of the user's service provider gets broken and the session, too is lost, or quite simply, in a dual SIM mobile, the user simply switches on the SIM (which is the registered mobile for the payment gateway to send the SMS to) a few seconds or minute after touching the "Pay now" option (obviously, this is a dual sim mobile phone app test scenario).

There is a hilarious story that explains the parallel human behavior (I am a strong believer that software design evolves (not just out of tests as in TDD) out of the culture of the region) of such a scenario nutcase that goes, "I know, I know what he 'thinks'" to another nutcase that calls it up to ask for an 'update' (with no possibility of corroborating on a 'thought' of another person (leave aside the thought of the same person) but it gets best explained by actually knowing the nutcase and its group of  'girlfriends' (ie., because the nutcase 'thinks' (it is quite possible for roles to get switched here due to the language and interpretation ! :D) that the other person 'thinks' that it is talking to a girl, it uses words that one uses only with girlfriends while, on the other end of the phone, the man may simply be cursing the nutcase or quite simply, the mother (as in 'Psycho's mother)!

To get back to the bug, this means that while the app tries to desperately read the last (most recent) SMS received and does not find it and gives the user the option to use the "Regenerate OTP" option and one scenario is that the user touches it as a selection, by which time, the previously generated OTP gets sent and the app once again, goes into the automatically submit OTP option! This now results in the second scenario that of the "Enter OTP manually" option, which if the user uses results in the wrong OTP getting entered into the text area because the newly generated OTP is queued but has not yet been received by the user (for whatever reason, one being that the user's messaging space is full and the other being, the network) and if the user loses patience and presses the Regenerate option and deletes the earlier SMS then it results in another cycle of confusion!

Sometimes convention is not the best of reasons to use or follow in design (especially in software design) and neither should too much of user friendliness be the yardstick to judge a design as the right design because over-zealousness, in software design, actually translates to "greedy" and even though a "greedy" design may work but an "over zealous" design will (or must) fail as the human factor, that of using time and space, in contrast, will always succeed!

Tuesday, 15 November 2016

When a famous singer becomes your Facebook friend...

Quite a few have begun to notice that I am an extremely humble person especially after I mentioned this wonderful trait of mine in this blog, a few posts back! It is not often I repeat myself but, somehow, this instance seems too good to indulge in fickle humility - fickle, because it rarely stays by my side, humility, that is.

A very famous singer (or maybe quite a famous one) sent me a friend request on Facebook and when the notification appeared on my mobile screen, I was skeptical - there were so many of these fake profiles, it could hardly be her, could it, I mused for a few seconds, before accepting the Friend request.

As soon as I could put my hands on my laptop, I quickly decided to login to Facebook and check her profile out. The tick mark that is usually associated with famous personalities was missing but looking at the friends list, the nationalities seemed to match - quite possible that she has just joined in with Facebook, which is quite strange, because she is of the current generation and although, Instagram could have been her patron's or her sponsors' choice, Facebook was not so bad, was it, that they gave it a miss for their star?

Putting aside all these thoughts, I decided to pen a few lines of poetry for her, hoping for either getting a Like from her (she had only 73 friends in her profile, so the possibility of her reading my poetry was quite high - that a Facebook status updated would not consist of poetry is hardly a thought of substance to much dwell on and I don't waste my time on dwelling) and I did come up with some really beautiful lines that I managed to collect while watching "Doctor Strange" (in 3D) as the scene where the mirror dimensions and the real time juxtapositioning happen between Dr Strange and the Ancient One.

What you see is how they are,
How you see is what they are,
Sometimes dark, sometimes blue and sometimes grey they are,
Shaded to protect what you are.
What they see from without is within Space
and without Time but with the same eyes
that sees Time and Space but without the skies

What they see from within is under the skies.

The inspiration was in 3-D and in sci-fi but the tragedy was in black & white that when I reached back and posted the lines and tried to find the name, it just would not appear in typeahead !!

She was gone! Not in my friend's list !! I felt like Steve Martin in The Dirty Rotten Scoundrels, when Michael Caine introduces the Princess and is rapped on the knuckles and made to squat on the toilet seat, and Martin goes, "NOT MOTHER?" Another way of saying it is like when the notorious female tries to swindle the two swindlers by dreaming about others' hard-earned money but finds herself in prison for having gone too far than her limited intelligence would allow her.

Thursday, 4 August 2016

Angular material - Cards tip

The fact is, that many times, we miss some obvious solutions that exist in the form of a simple attribute of an object and waste time using techniques that are no longer applicable because of the way technology and tools have emerged and those who do not recognize either end up with redundancies - in practices, techniques and attitudes.

So, when I read a question that was about managing a user login that was not returning to the login page after the user logs out or the session expires, I noticed the usage of a 'localStorage' object, which is the most common thing to do but if instead, the sessionStorage object were to be used, many knowledgeable would see that it solves some major problems straight away, without the usage of any special 'routers' (the software ones), it became clear to me that what the knowledgeable know is not through knowledge or more years of study but due to their experience.

AngularJS and Material (or for that matter, any technology that uses declarative forms of programming - declarative, in this context, does not mean annotations (as in Java) or attributes (as in C#), but as in programming through attribute (as in XML) values and directives (as in AngularJS)) are quite likely to put many of its programmer users in such situations.

One such instance that I wanted to share is inspired by another question on the same forum that was about deciding on AngularJS as a language to use in the project and what should be the criteria in making such decisions.

Rather than elaborating far too much on what could be bread and butter for many, suffice it to say, here goes !

Layouts, for the mobile, any-size-device, and the web, can be as simple as

<md-content layout-gt-sm="row" layout-gt-xs="row" layout-padding border="solid">

and the same layout fits for any device.

One of the most effective example of what should be the criteria for deciding on a language for a requirement (web or mobile app, though, only!)

Friday, 24 June 2016

White in Angular Material - tip

It is not a matter of black or white or any racial discrimination; it is quite simply a matter of the palette. Not that this indicates any taste or lack of it but because it is a colour, it must exist in some palette.

In Angular Material, the colour 'White' simply does not exist. It does, so to speak, but in the .backgroundTheme and to use it, you need to extend the grey palette (using the Google colour themes).

So, what do you do to colour your background 'white'? You simply create a new background theme and extend the palette whose hue you want to change or use! Like so,

var app = angular.module('modulename', ['ngMaterial', 'ngAnimate', 'ngMessages'])
    .config(function($mdThemingProvider) {
        var background = $mdThemingProvider.extendPalette('grey', {
            'A100': '#FAFAFA' // Not exactly white
        $mdThemingProvider.definePalette('background1', background);

The newly defined palette now can be used with any other palette like the primaryPalette.

But that is not all for, this, you can find in the issues list of the Material forum. Where it gets tricky is when you need to make AM recognize the colour, which Angular Material simply refuses to.

To make the new palette work for, say, md-toolbar, you need to wrap your md-toolbar in md-content for Angular Material to pick the colour from the theme.  

Friday, 25 March 2016

Nuttify to contextify and be nuttified

The all new circular references

I guess somebody out there got really miffed (which is not surprising because the government as defined by political parties is usually to 'represent' masses (to get votes) and if the masses are nutcases then the government will be representing nutcases - a kind of a circular reference or a Catch -22, for progressive minded sane people) with how the bureaucracy and the government works, who keep blaming each other or asking for newer things; much like how the traffic cops usually know how to ask for docs that you don’t have and at times for bribes, for which you do not have the money!

With JsDom, it is similar. JsDom requires a particular version of NodeJS. 

Cool, so you get the latest version or upgrade with npm, right? Wrong. Because NodeJS simply refuses to respond until you nativize your Contextify.

But, why do you want to Contextify, in the first place? You don’t but you have to because you want to use JsDom.

But why do you want JsDom? Because you want to jQuerify.

But why do you want to jQuerify in NodeJS if you can simply use jQuery?

Because you want to jQuerify and Ajaxify the scripts in your HTML DOM so that you could trick the user into believing that you are using a server while using a browser but which in turn is false because it turns out that it is not a trick because even a browser is not used.

And to do all these Trickifys, you need your native IDEs like Visual Studio or xCode because you cannot compile native modules as they are machine specific!

Much like how nutcases who believe that you cannot survive by doing everything on your own without their help (imagine Nuttifys to make believe the nutcases to believe that they are not nutcases and you get the picture!).

Or, in much clearer terms, it is how some nutcases want to 'liaise' with you to fix a marriage or even a job interview for another while being already married. So why should the nutcases do so? Because...dash it, that is why they are nutcases, I can't possibly answer every question in this world, can I? Do some homework on your own.