Hello World

November 18, 2009

After a short hiatus, I am back again into this corporate world. So, it’s hello to the world all over again.

As I play with some new tools, expect some posts on WCF, WPF and Silverlight in the coming days. Watch this space.

 


Telecon with global team lead

April 10, 2008

We all know what conference rooms are. We also know that employees-conference rooms ratio is not really ideal in most of the organizations. People haggle over rooms for their meetings, telecons, presentations and what nots.

Thanks to a very strict manager in my previous organization, I know the importance of booking a conference room for any meeting and being present in the room well before the designated telecon time. Looks like no manager in my current organization has been able to teach these simple “rules” to the employees here.

We have meetings like innovation workshops, code reviews and tracking meetings and are less critical compared to telecon with the overseas team or “global team lead”. Still, we religiously book a conference room and park ourselves there well before time. 9 out of 10 times somebody would have occupied it. We have to “display” ourselves and let them know that we are waiting for the room. Apparently, they don’t get the message. They think we are snooping around to see if there is any room which we can hijack. After waiting for a few minutes, we knock and tell them in clear words that the room is ours because we have booked it.

What happens next depends on who is asking for the room. If it is a young person, they usually write off saying they booked the room and kick us out. If there is a guy looking like a lead, then there is a sarcastic “You booked the room? We have been using this room for telecon since 2 years” as if that gives them the authority to hijack the room whenever they want. If there is a manager around, a senior guy from the hijackers team will make a sincere yet authoritative request “We are having a telcon with the global team lead. I am already on the call. Can’t hang up now. Please find another room for yourself.” The word ‘please’ is hardly audible.

Now this is where my blood starts boiling. Nobody, not even the manager, not even the lead dare even ask “If you have a telecon with your team lead, why didn’t you book a room”. Why doesn’t anybody have the guts to say that? If I could have it my way, I would barge into the room and ask all of them to leave.

Somebody please come to my organization and put some sense into all the heads here. All the people need their brains to be washed with Mr. Brain Whitener and need to be taught about etiquettes.

If you are reading this and are guilty of hijacking a room, I urge you to stop doing that. Please.


The Last Lecture by Randy Pausch

February 25, 2008

Randy Pausch, a professor at Carnegie Mellon university has only a few days to live. He gave his last lecture a few days ago. This is the video of his now famous ‘The Last Lecture’. What do you think would be the last words of a dying man?

Youtube link

Google Video link

The complete lecture (1 hour 25 mins)


Hungry eyes

February 18, 2008

A darshini in J.P.Nagar. Friday Evening. Around 8.30.

It was a long, tiring day. No mood to cook and no patience to wait at restaurants waiting for food. “Dinner at a darshini?”, asks my husband. Sounds good.

We ordered dinner, as in we paid for it and collected it from the counter. A young man is relishing his noodles. A couple is busy stuffing the kid with idli. The road is almost deserted – 9 is late in Bangalore. An empty table at the far end, almost touching the road. That will do.

As I am gulping down my meal, my eyes lock with another pair of hungry eyes. I look away embarrassed. The other pair continues to stare alternately at me and my plate. A tug at my heart, a wrench in my stomach and my mind made up itself to face the situation.

I walk up to the owner of those hungry eyes.

“What’s your name?”

“Asif.”

“Do you know Kannada?”

He shakes his head.

“English?”

Shakes again.

“Which language?”

“Urdu.”

“Kya khaoge?”

No answer. I can see he is embarassed, ashamed.

“Idli khaoge?”

His eyes light up. He is almost inaudible. “Bhel Puri.”

“Idhar hi ruko.”

After five minutes, the darshini-wala calls out, “One plate bhel puri.”

I look around to spot the eyes. They are no where to be seen.

Darshini-wala says, “Is this for that boy?”

I nod.

He and his colleagues start searching for that boy. He is hiding behind a car. They call him. He shakes his head.

One guy shows the parceled bhel puri to the boy. “This is for you”, he says.

The boy is still not sure. Reluctantly he comes to collect it. He collects the parcel, and walks out, not even once looking at me.

Darshini-wala says, “He comes here everyday. Some four-five times. He will come back again after some time.”

I ask myself, “Did I do the right thing?”


Why do we support the weaker one?

February 7, 2008

Watching Australian Open last month was fun, to say the least. We saw a lot of upsets. Federer challenged by Tipsarevic in round 3, the defending champion Serena Williams thrown out in quarter finals, the World No.1 Federer and No. 2 Nadal failing to reach the finals – this was one nail biting tournament.

I watched the semi-finals between Djokovic and Federer and then the finals between Djokovic and Tsonga. Amazing matches, both of them. In the semi-finals, the crowd was cheering for Djokovic. There were many Federer fans present, no doubt, but Djokovic fans were more vocal in their support.

Cut to the finals match and the exact opposite happened. People were cheering for Tsonga. Djokovic fans were unusually quiet. Djokovic showed his disappointment about this in his acceptance speech.

The match was not about Serbia vs. Switzerland or Serbia vs. France. This was about strong vs. week. The crowd was not cheering for the country the player represented but the quality he represented. In both the matches, the crowd wanted the weaker player to win.

Why are we humans like this? Why do we want the weaker player to win? Is it because we want to boost his confidence or empower him? Even if either person wins, the crowd doesn’t really gain anything. What do we gain by supporting the weaker player? To feel good that we didn’t support the obvious winner but supported the less obvious one and hence did a good deed? Or is it just because we want to see an upset and hence a hot news to talk about? What is the intention behind this loyalty shift?

Why only the crowd, even I wished the same. My loyalty towards Djokovic suddenly shifted in the finals and I was hoping Tsonga wins. If I ask myself why, I am not happy with the answer I get. I want the weaker player to win because this will create a new sensation and breaking news and I have something to talk about. I want to discuss/gossip about how the champion was defeated and that gives me some wild pleasure. Strange!

What’s your reason? Why do you support the weaker player?


Being nice to rude people

January 9, 2008

During our routine post-lunch chit-chat, my friend made a gem of a statement – “It is easy being nice to nice people, but how can you be nice to rude people?”

I had been thinking about it for some days now and I was shocked when she made that statement. It was as if she was reading my mind. Many people would term it as a co-incidence, but I believe that incidents happen for a reason. This was no co-incidence. This was His way of sending a message across. But, I digress.

So, as soon as she said it, the words struck me. Few of my acquaintances are extremely sweet to me- always ready to help in any way they can, and I too reciprocate. I try to be nice to them as much as I can and all is well.

For the past few days, I am trying to be nice to people, and no where near being successful. I try to think before uttering a word so as not to offend anyone. But, whenever I encounter rude people, caution goes flying out of the window. Their act might be intentional or unintentional, but the point is they are rude. I find myself reciprocating in this case too. I use harsh words, sarcastic tone and I get a warm, fuzzy feeling for settling scores with them.

I know a few people who are nice to everybody. Even if someone is rude to them, they smile and act as if nothing happened – not a glimpse of anger, no teeth-grinding. I wonder how they can be nice to people who are mean to them?

Harsh words don’t upset them? Or they do get upset, but are capable of hiding it so well? Do they smile and bear with it only to bitch later and vent their anger? Do they feel superior to the other set and prove their superiority by forgiving? Do they feel sorry for the lesser mortals and hope they rise above the sins? Or is the secret word empathy here?

I will go on asking questions, but will never get a definitive answer. In effect, we come back to the statement we started with: “It is easy being nice to nice people, but how can you be nice to rude people?”

Your thoughts?


DataGridViewComboBoxColumn requires multiple clicks to select an item

January 8, 2008

If you have ever used a DataGridView with a DataGridViewComboBox column, then you would have definitely noticed that you need multiple clicks to select an item in the combo box. This is very annoying because every time you want to select a different item from the combo box, you need at least 2-3 clicks.

Fix

Fortunately, there is a simple fix for this: set the EditMode property of the data grid view to EditOnEnter. So, when the user enters the control, the cell is automatically put in edit mode, so when you actually click on the combo box, you can see the drop down list.
A bug

That being said, there is a bug associated with this. With the EditMode property set to EditOnEnter, when you select a row by clicking on the row header, the entire row is selected, but one cell will be in edit mode. What this means is if you try to delete the row by selecting the row header, you cannot delete the row because the delete key is actually being sent to the cell being edited and not the row.

This page has more details on this bug and also a workaround.


Mindtree Osmosis 2007: An external view

December 18, 2007

 

 

Last weekend, I attended Mindtree’s annual tech fest, Osmosis. This year they had organized the fest in the unconference style. To quote from their site

“To foster greater participation and to cut through the air of formality, Osmosis 2007 has adopted the “unconference” mode. Unconference merges the distinction between the speaker and the audience, and everyone is a participant.”

Also, this year they opened the doors for external participants, which is why I could attend it. My brother invited me over and we both had a lot of fun, to say the least.

The day began with a talk by Ashok Soota, Chairman of Mindtree. This talk itself was in unconference style. Soota spoke for a few minutes and left the ground open for participants to ask him questions. After the short and sweet talk, unconference sessions began.

The first session I attended had a rather controversial title ‘Are software engineers getting extinct?‘ With great minds like Bagchi, Soota, KK, Partha, Kamran, Desmukh in the room, speakers had a tough time controlling the audience. The argument was basically that the magic of software industry is fading, and with automation being the talk of the town, software might become extinct. The session saw some good participation from the audience.

Twitter session caught my attention next. This session was like an introduction to twitter and micro-blogging. It was not very useful for me because I knew about twitter beforehand. This was more like one-way information flow, there was not much to argue or discuss, so no heated debate here.

I and my Project Manager was the next session which me and my brother wanted to attend. But by the time we reached the room, it was so jam packed, we didn’t have place even to stand. We got to rest our minds for half an hour before breaking for lunch. There was live music by MAG, Mindtree’s very own musical band and they belted out some good numbers.

Post lunch, it was the much awaited session on Google’s Android. It was meant to be an introductory session on Google’s mobile OS and SDK, but the session veered to the debate mode when one person decided to argue about every point the speakers made. The speakers were not prepared for this and it was clearly evident. Some good points made by Mindtree minds about why we need Android at all and why open source is scary!

Another controversial topic – Innovation. After being fed up of the ‘compulsary innovation’ at my organization, I was hoping this session will help in venting out the frustration. Sigh, it only added to it. I saw the same attitude in Mindtree too. People who belong to the innovation team are all ga-ga over it and always inspiring (read as forcing) people to think out of the box and innovate, whereas the rest of the world is fed up of it and cringe whenever they hear the word innovation. We had some good argument about what is an idea, an innovation and an invention.

This was followed by the grilling session of CTOs Vinod Desmukh, CTO of R&D Services and Kamran Ozair, CTO of IT Services. The two minds were bombarded with questions collected previously from Mindtree minds. There were some interesting questions and both of them handled it really well. This session gave a glimpse of how strong both of them are in their respective domains. I was floored.

Mr. Bagchi took over next and gave a totally different speech. The Bagchi on stage was completely different from what I had imagined him to be. The T-shirt clad bald man on stage cracking jokes on his colleagues and sometimes being not so politically right was different from the man who I had seen through his columns in TOI. With this the unconference session came to an end.

This was the first time I attended a fest in this format and honestly, I didn’t know what to expect. The moment I stepped into the conference hall, I knew I was going to like it. The atmosphere was electric and the attitude, contagious. When so many great minds (read as nerds) come together and discuss their passion, how can it be not good? It was a pity to see some girls touching and re-touching their make-ups in rest rooms when such serious debate was going behind closed doors. Apparently some people turned up to have fun in a different way.

The whole thing was organized very well. Every session started on time and ended on time – it is mind boggling to even imagine how this was achieved. Facilities like lunch, coffee, tea, handouts, badges – everything was in its place. As an external participant, I was awed! And I was told the whole credit goes to Shahnawaz Khan. Special thanks to him – he does make it look so easy. The standing ovation he got at the end of the day just goes on to say how much hard work and effort he had put in.

As an external participant, I am in awe of Mindtree. To try something like this and to let outsiders attend, takes a lot of guts. Mindtree took the plunge and came out victorious. I enjoyed every moment of it and this weekend was one of the very few weekends which I consider well spent. Now that the unconference is over, I wish it comes around soon. I can’t wait to attend Osmosis 2008.


Datagridview: Get SelectedIndex of DataGridViewComboBoxColumn

December 7, 2007

This seems to be a straight forward thing, but Microsoft only knows why this simple feature is not supported in DataGridView.

If you have a ComboBoxColumn in your DataGridView and you want to know what is the selected index of the combo box, then you need to do this:

1. Handle the EditingControlShowing event of DataGridView. In this event handler, check if the current column is of our interest. Then we create a temporary ComboBox object and get the selected index:


private void dataGridView1_EditingControlShowing(object sender,
DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 0)
{
// Check box column
ComboBox comboBox = e.Control as ComboBox;
comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged);
}
}

void comboBox_SelectedIndexChanged(object sender, EventArgs e)
{
int selectedIndex = ((ComboBox)sender).SelectedIndex;
MessageBox.Show("Selected Index = " + selectedIndex);
}

A rather round-about solution where a simple one would have sufficed.


Right click on TreeView: Get the node clicked at

November 6, 2007

Problem:

There is a TreeView control with n number of nodes. When the user right clicks on the TreeView control, get the node on which the right click was performed.

Background:

In TreeView control, SelectedNode property is set whenever left click occurs. This is not true for right clicks. So, we need to have some workaround for this.

Solution 1:

The most popular solution is to handle the MouseDown event. Check if the click was a right click and then use the TreeView control’s GetNodeAt API to get the node which was clicked at.

private void treeView1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
TreeNode selectedNode = treeView1.GetNodeAt(e.X, e.Y);
MessageBox.Show("You clicked on node: " + selectedNode.Text);
}
}


Solution 2:

Handle the NodeMouseClick event. The TreeNodeMouseClickEventArgs has the node which was clicked at.

private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
MessageBox.Show("You clicked on node: " + e.Node.Text, "Solution 2");
}
}

SelectedNode property of a treeview is set whenever a left click occurs. Why can’t the same be applied for right click? Right click on a treeview is such a common UI event, that users will benefit from it.