Sunday, June 2, 2013

Infosys brings back Narayanamurthy - my take

Everyone in the industry is talking and writing about Infosys and the reappointment of Narayanamurthy to be at the helm of things. So here goes my two cents on what I understand and see...
 
Let me be honest on how much I know about Infosys - I was reading a bit about the company because I was interviewing with them a few months ago and I wanted to see if I would be able to add any value to their overall vision at any level.
 
From what I have observed in the last few years, since the time of the sub prime crisis in the US and the global economic meltdown, strategies have changed through all the IT Services companies.
Saving cost and providing cost effective solutions seemed to be what every CIO wanted, especially in the core and giant customers.
 
While every IT Service provider was scurrying frantically to find pieces of cloth to cover their hind parts, Infosys went ahead to build the "enterprise for tomorrow" for their partners... it appeared ambitious and I must admit only an Infosys or a TCS could even afford to think of proposing such a thing and I really think we must appreciate the Infosys 3.0 for its sheer guts. Maybe it was just bad timing.
 
But where I think it faltered and went wrong was with winning and retaining existing large/core customers - as their goals and vision where badly juxtaposed with the ambitious ones of Infosys. It is quite natural for the sales teams to get carried away by something as phenomenal as Infosys 3.0 but it is just unfortunate that the global customer base was too worried about today and not able to think or plan big for tomorrow.
 
I strongly believe that a leadership team or a leader of an IT Services company should have a good mixture of Sales, Technology and have a constant watch on what we have in our hands today. Investments can be made aggressively in a booming market but when things are sluggish just keeping every penny close to us and ensuring the existing customers are happy.
 
You never know but 9 out of 10 times there are opportunities within the same customers. Proactive thinking and solutioning, helping customers with their goals even if detrimental to ours actually wins in the long run.
 
The right word to explain the situation is that the market is now SATURATED. Every avenue has been explored widely and now is the time where we are only left with option to dig deeper.
Talking about the leadership team there is not much difference to expect within IT Services company in India as all of them follow the standard Income - Profit = Expenses formula for profitability. Bigger the company the more number of seconds you get to gasp for a breath... BUT bottomline is we are all gasping for breath
 
About Narayanamurthy,  no offence to him, he is just in at the right time and will be able to ride a bit on what has happened in the last few years and get things back with just a little bit of tweaking... of course would involve a lot of hard work and he brings his son to help him out in this venture... typical clich├ęd hereditary bonding...
 
Setting aside competition within the market and in the general interest of the market, Infosys SHOULD do well in the coming days as they are the pioneers and only large players such as Infosys, TCS and Wipro have the muscle power to pull things through and thereby paving the way for the rest of the industry to march behind.

Sunday, April 28, 2013

System cannot log you on now as the domain is not available - Fix

Just wanted to document this some place where I could refer easily. Faced this issue when I was trying to log on to my  laptop provided at work. The error message was "The system cannot log you on now as the domain (domain name) is not available".

Since I did have the admin rights on the machine, I was able to regedit myself the next day after I consulted with a nice gentleman from the tech support team

Step1:
1. Start --> Run --> RegEdit and hit enter
2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
3. Look for the key cachedlogonscount
4. Set the value to a 3 or a 5
5. Log off and log on while you are on the network for a couple of times to get the credentials cached

That is it. With your credentials cached, you would be able to log on to your system even while you are NOT connected to the network domain.

Sunday, September 30, 2012

How to remove ad.yieldmanager, ad.doubleclick.net, ad.xtendmedia adware/spyware


This annoying adware somehow seeped into my personal laptop and it was really annoying. While I am positive that it was not a virus, it certainly was showing up popup ads on the bottom left corner of almost ALL websites that I would browse.

I tried numerous things including checking my startup application, services to see if there were anything suspicious that I could stop by myself. Nothing helped. Next I tried deleting cookies, clearing my temporary internet files. Still… nothing.

I then Googled for hours to find a way to remove them and went ahead to try every single suggestion including installing a slew of spyware removal tools. Most of the tools were either not able to even detect these adwares as a threat or even if a few did, they would want you to pay for them to “clean” your PC.

I was not inclined towards paying nor was I willing to put up with the annoying popups. As a matter of fact, since I knew these are adware popups, I became paranoid everytime I saw those stupid ads come up. They were eating up my internet bandwidth and I could do nothing about it.

FINALLY, this is what I did which worked!

On a hunch, I checked the HOSTS file (usually in C:\Windows\System32\drivers\etc folder). The first time I saw the file, it looked clean. I originally wanted to map the ad.yieldmanager to 127.0.0.1, but there was this thing I noticed – the thumb on the scrollbar was too small indicating that there was something I had to scroll down to… And when I scrolled down and further down it was all empty spaces and at the extreme bottom of the file the dirty rascals who had infected my PC had their secret entries made. Each of the websites that the popup links were pointing to had specific IP addresses mapped. I removed them all (after granting necessary permissions on the hosts file because of Windows 7) and as an extra safety measure I went ahead and subscribed for a few TPLs on my Internet Explorer 9.

I then fiddled a few of my browsing sessions and found them to be clean. It was really exalting to fix an issue, completely clean, by yourself!!!

Sunday, November 21, 2010

Scrolling to the Top of an Aspx page conditionally

Sounds like a simple task right? Maybe thats why I accepted to help my team mate on this functionality despite being in the middle of a really hectic week. I admit, it took me a little longer than my estimated "10 minutes" to get this to work. It was one LENGTHY "ajaxified" aspx page and the requirement was - to scroll the page to the top IF there were exceptions on save. Apparently there was an error message displayed on top of the page. So IF there were any exceptions on save - the friendly error text gets displayed there. Among many other options suggested and provided, the business users (you know, the people whom we bill our timesheets...) preferred the scroll functionality - because according to them, I quote - "that sounded the easiest". Yeah. Tell me about it!

I tried registering a javascript to scroll the window to co-ords 0,0 - which did not work.

If I made the page to always scroll to the top, then on EACH callback, the page would go right up - which is wrong again. So had to flag it and follow up and on a conditional basis.

For which I had to make the below code changes to get the page to scroll correctly:

Add the following to the markup:
<script language="javascript" type="text/javascript">

var errorEncountered;

errorEncountered = 0;

function scrollTop() {

 if (errorEncountered == 1) {

 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(scrollTop2);

 };

}

function scrollTop2() {

 if (errorEncountered == 1) {

  scrollTo(0, 0);

  errorEncountered = 0;

 };

}
</script>

Add the following to the code behind at the catch of an exception on save:
System.Web.UI.ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "Script", "errorEncountered=1;scrollTop();", True)

Wednesday, June 2, 2010

Flex Glass Headers

When i first started to work in Flex almost a year back, I was so eagerly looking to grab as much goodies as possible and make my application look spiffy. I remember staying all night long at work so many times, just to explore options by visiting many sites and applications built using Flex, primarily to get sources of inspiration.

One such application was the Flex Style Explorer. The one thing that I loved the most was the mild glossy look it had on its title; Luckily it had the view source enabled and I went on to see how the guys had done that.

It was a mere reference to a transparent flash sprite compiled into a swiff file and was referred from inside the CSS - set as the backgroundImage of the panel.

I went on to build my own header using flash in the next few minutes and added my own version of the glossy look to my application.

Click here to see the image of my app title before and after.

It was such a mild difference, people could hardly notice it; but it hugely enhanced the overall aesthetics of my application. People LOVED the look and feel but no one guessed it. I went on to use this header smartly across the application onto different controls wherever possible.

Flex Renderer Recycling

Thought it would be useful to just mention about renderer recycling 'feature' that is inherent in the Flex UI control handling.

Often this could burn your time if not handled properly at the time of building your application.

The Problem:
When you scroll through a list control which has a huge list of items and is bound with an itemRenderer, the items in the list control tend to shift its positions randomly, as you scroll.

The Reason:
Flex by default tries to reuse the item renderers. In other words lets say your list control has about 40 items. It is not necessary that Flex would generate 40 itemRenderers to display the list.
Instead, based on the display area available, it would generate a few itemRenderers, just enough to handle the current display area and probably a few more for buffering.

As the users scroll through the same itemRenderers get reused and the contents that need to be displayed, in other words the next item data will be rewritten onto that itemRenderer.

So in total the creationComplete event on the item renderer would just fire once and it is not necessary that it would fire for every item added to the list again because of this reusing concept.





The Solution:
Override the set data function on your itemRenderer which would give you access to the actual item that is being bound to the itemRenderer at that point in time, and in this function you could take care of binding the item the way you want.

The set data is bound to get called many times during the process of creation/change resize etc...
For an example of overcoming the renderer recycling issue and how to override the set data function, check the example here.

Flex TileList ItemRenderer with Drag and Drop Sample

Moving on to Flex 4 since last month, I think it is time to publish a few of the small things I had done in Flex 3.

This one is a simple but nice - drag and drop example from one of the modules I had built. It is not the entire application of course; just a stripped down to basics version that just explains a few

The example handles issues like renderer recycling and explains how a custom item renderer can be used which in turn could have its own set of child controls.

The source for this can be found here and a live example here.

P.S.: When viewing the demo, just click on Open if your browser prompts you about handling the file.

Monday, March 1, 2010

Flex Expand Collapse Panel - Custom Component

It has been an extremely long time since my last post. To explain the delay, I would need to write about half a dozen posts. That comes later. This post is just to record a very simple and basic custom component I did a few days back.

It is a simple component extending the Panel and just adds a small Maximize/Minimize toggle button on the top right corner that resizes the panel based on the dimensions specified in the markup.

I blame the requirement for the simplicity of this component. It is just what they wanted. Nothing fancy about it.

It was quite simple to do. The only challenge was to deal with Flex as it does not know what to do when the component has its own set of child components declared internally and also when we try to add a few more, at the declaration…

The solution was pretty straightforward. The source code is available here and I tried to host an example here. When viewing the demo, just click on Open if your browser prompts you about handling the file.

Friday, August 14, 2009

Flex Time

The last 3 to 4 weeks were terribly tiresome. The application that we were building was already running on a stiff deadline and we had entered into the meat of it at this point. It was thrilling to execute everything that was earlier planned. I kept foraging my desk draw for the invaluable information I had had hurriedly scribbled some weeks back. They help me to remind myself of what exactly was discussed. Somehow, no soft copy could do that for me.

Anyways, working late night continuously has helped me gain some decent level of fluency in coding with Flex. The Java Web Services were pretty straightforward.
Also, since I was at times given company by my colleague who is from Orissa, I have learnt how to swear in Orriya. I often swear at the Flex builder for being so shamelessly slow or at some of the insipid methods or definitions in ActionScript.

Somehow a few of the bigger challenges have been taken care of. There are a few more to go before we reach the comfort zone. Of course, when the testing phase is on it could all come down – but then that is a different story altogether.

Wednesday, July 8, 2009

Dynamic Menu using Flex

I think it is time now to share some of the initial work I have done in Flex which served as a part of my learning process as well.

A dynamic menu - fully populated from data stored in MS SQL - fed via a web service.
It is important to mention that most of the functionality was pretty much handled in the web service (IMO, that is how it should be).

The only thing I learnt in flex through this project was to use the Menu control and to perform a simple WS call.

The database has a table 'tbl_menu' that stores all the menu details. It references itself via the field ParentMenu_id for sub menus.



The only input the Flex page needs is a cleanly formatted xml string. So that is what the WS is going to return:


[WebMethod]
public string GetMenuByClass(String usrclass)
{
StringBuilder sb = new StringBuilder();

Dictionary> dict = new Dictionary>();
dict = GetMenuDict(usrclass);

sb.Append("");
sb.Append("");
foreach (int key in dict.Keys)
{
sb.Append(AddXmlString(dict[key]));
}
sb.Append("
");

return sb.ToString();
}


It is just a plain method that uses StringBuilder to append the xml string. There are a hundred different ways to construct the xml, but that is not part of this sample.

Also you would notice soon that we are using a simple object class 'MenuInfo' that represents the actual DB entity which will be used that to pass around data.

Next, the GetMenuDict function takes care of populating a dictionary with all the menu data it pulled from the DB:


private Dictionary> GetMenuDict(string userAccessCode)
{
Dictionary> dict = new Dictionary>();

List menuItems = new List();

menuItems = GetMenuFromDB(userAccessCode);

foreach (MenuInfo m in menuItems)
{
// root element - 0 or NULL
if (m.Parent_Link_id == 0)
{
if (dict.ContainsKey(m.Parent_Link_id))
{
dict[m.Parent_Link_id].Add(m);
}
else
{
List lst = new List();
lst.Add(m);
dict.Add(m.Parent_Link_id, lst);
}
}
else
{
// not a root element - parent exists. find it and add this guy to his list
MenuInfo mInfo = null;

foreach (int key in dict.Keys)
{
mInfo = FindMenuInfoRecursive(m.Parent_Link_id, dict[key]);
if (mInfo != null)
{
mInfo.menuList.Add(m);
}
}
}
}

return dict;
}


The GetmenuFromDB just reads the data from the Database using a datareader and returns a list of MenuInfo. The more inportant function is the FindMenuInfoRecursive, which takes care of handling the sub menus. With this method the sample supports infinite level of sub listing menu items, by just setting the appropriate ParentMenu_id.


private MenuInfo FindMenuInfoRecursive(int id, List menuList)
{
MenuInfo menu = null;

foreach (MenuInfo item in menuList)
{
if (item.Menu_id == id)
{
menu = item;
break;
}
else
{
menu = FindMenuInfoRecursive(id, item.menuList);
if (menu != null)
{
break;
}
else
{
continue;
}
}
}

//finally return the menu object
return menu;
}


The AddXmlString is the method we are going to see next:


private string AddXmlString(List menuList)
{
StringBuilder sb = new StringBuilder();

foreach (MenuInfo m in menuList)
{
if (m.menuList.Count > 0)
{
//should continue
sb.Append(String.Format("", m.Name, m.Name));
sb.Append(AddXmlString(m.menuList));
sb.Append(String.Format("
", m.Name, m.Name));
}
else
{
sb.Append(String.Format("", m.Name, m.Name));
}
}
return sb.ToString();
}


With all this done at the WS, it leaves us with very little to do at the Flex end. We would just be making the call to the WS and merely bind the results.


public function WSMenuSvcResultHandler(event:ResultEvent):void{
var dataXML:XML = new XML();
dataXML = XML(event.result.toString());

var myMenu:Menu = Menu.createMenu(null, dataXML, false);
myMenu.labelField="@label";
myMenu.show(10, 20);
}


The full C# source for this example is here and the Flex source is here.