Monday, November 25, 2013

Angola denies "BAN of ISLAM"

இணையத்தை தேடும் போது, இதுவும் வதந்தி அடிப்படையில் வந்த செய்தியாகவே தோன்றுகின்றது. குறித்த நாட்டில் பெரும்பான்மை கிறிஸ்தவர்களுக்கும் 1% இற்கும் குறைவான முஸ்லிம் சமூகத்துக்கும் இடையில் முறுகல் நிலை உள்ளது என்பது உண்மையே. ஆனால் இப்படி ஒரு முடிவை தமது அரசாங்கம் எடுக்காது என்றும், தமக்கு அப்படி ஒன்றை அறிவிக்கவில்லை என்றும் அமெரிக்காவில் உள்ள அங்கோலா நாட்டு உயர்ஸ்தானிகர் ஒருவர் கருத்து தெரிவித்துள்ளார். அநேக சமூக வலைதளங்களில் இந்த செய்தியுடன் பரப்பப்பட்ட பள்ளி ஒன்று இடிந்து விழுவது 2008 ஆம் ஆண்டில் இஸ்ரேல் நாட்டில் எடுக்கப்பட்டது என்று International Business Times கருத்து தெரிவித்துள்ளது. ஒரு செய்தி "அங்கு சொல்கிறார்கள், இங்கு சொல்கிறார்கள்" என்று துவங்கினால், அது ஒரு வதந்திகான முழு தகைமைகளையும் கொண்டது எனலாம்.

பொறுப்புள்ள முஸ்லிம் சமூகம் என்கிற வகையில் சில "பரபரப்பான" செய்திகளை ஆர்வத்துடன் பதிவிடுவதற்கு முன்பு, குறித்த செய்தி "பரபரப்பாக" பேசப்படுவதற்கான காரணம் என்ன என்பவற்றை ஆராய்ந்து பதிவிட்டால் "வதந்தி" பரப்பிய பாவத்திலிருந்து நாமும் விடுபடலாம்.

IBL இன் முழு செய்தி இதோ:


Thursday, August 29, 2013

Alternative way to get latest selected value from a Combo Box

In .NET at times the ComboBox acts strangely, when you try to select a value but returns a null value (Though the value is displayed in the dropdown list). Using the following work around in the SelectedIndexChanged event or SelectionChangeCommitted event should do the needful.

foreach (Binding binding in (sender as ComboBox).DataBindings)
                {
                    binding.WriteValue();
                }

  var whateverObject = (sender as ComboBox).SelectedItem;

If anybody could explain on what cases a null could be returned, it would benefit many including me. Until that the above solution should save your day.

Tuesday, April 23, 2013

Gearing up with Scrum

The guy in-charge of implementing Scrum at our office did an introductory session today at office. It creates a major break through from traditional project management by breaking up tasks in to manageable pieces, and short achievable deadlines. Tasks are generated in the form of User Stories and put up in the Product Backlog. A Product Owner will be responsible to prioritizing these user stories and will create a Release Backlog. A release backlog will have many Sprints which are either 2-4 weeks in length. The scrum team will be coached by a Scrum Master, who is in charge of driving the team. At the end of each sprint a working product should be available to show to the customer.

During the session many other colleagues asked their doubts and concerns over the process. I asked two questions for my part:

  1. If there is any particular feature request which the overall functionality could only be implemented for more than 4 weeks, how do we convince the customer?
Answer : No task can span more than 4 weeks. If there is such functionality it should be discussed with the team and should be broken into small chunks. Or such a sprint cannot continue.

     2. Regarding stakeholders, there are two roles; Involving or Committing. Will a particular resource(ex: A developer) be assigned to multiple scrum teams in parallel?

Answer : No. Scrum doesn't permit.

There was a nice video shared by a colleague which gives a quick insight into Scrum:


Tip to avoid flickers caused by Memory consuming controls.

You might face a situation where some standard or 3rd party controls being used in your application across various forms/windows. In any case you have a situation where you don't close any of the forms where those controls are being used, instead you hide them for some reason. These controls might cause a flickering effect on other forms particularly when the hosting machine is slow.

Recently I came across such a situation where an opensource listview control was causing a black ribbon like effect on other screens. After trying various ways, I was able to avoid it by disabling the visibility of it upon the Form Leave / Page Leave event.

Thursday, March 21, 2013

Difference between the keywords dynamic, var and object from C# 4.0 onwards

As a seasoned or professional developer in C#.NET, you will find many innovative features in the .NET framework supported to speed up development as well as reduce confusion in code. .NET 3.5 introduced the var keyword, and most of the time many blog posts and articles associated it with LINQ without the need to specify the type explicitly. Then .NET 4.0 introduced a keyword called "dynamic" which made us ask the question why another? As having extensively used System.Object for many interoperability related work, the introduction of these new keywords and it's uses might confuse developers as for why,when and where should these keywords be used etc. Below is an excellent excerpt from an article by Alexandra Rusina (Understanding the Dynamic Keyword in C# 4), which clarifies the differences between the three.


Dynamic, Object or Var?

So what’s the real difference between dynamic, object and var, and when should you use them? Here are short definitions of each keyword and some examples.
The object –keyword represents the System.Object type, which is the root type in the C# class hierarchy. This keyword is often used when there’s no way to identify the object type at compile time, which often happens in various interoperability scenarios.
You need to use explicit casts to convert a variable declared as object to a specific type:
  1. object objExample = 10;
  2. Console.WriteLine(objExample.GetType());
This obviously prints System.Int32. However, the static type is System.Object, so you need an explicit cast here:
  1. objExample = (int)objExample + 10;
You can assign values of different types because they all inherit from System.Object:
  1. objExample = "test";
The var keyword, since C# 3.0, is used for implicitly typed local variables and for anonymous types. This keyword is often used with LINQ. When a variable is declared by using the var keyword, the variable’s type is inferred from the initialization string at compile time. The type of the variable can’t be changed at run time. If the compiler can’t infer the type, it produces a compilation error:
  1. var varExample = 10;
  2. Console.WriteLine(varExample.GetType());
This prints System.Int32, and it’s the same as the static type.
In the following example, no cast is required because varExample’s static typed is System.Int32:
  1. varExample = varExample + 10;
This line doesn’t compile because you can only assign integers to varExample:
  1. varExample = "test";
The dynamic keyword, introduced in C# 4, makes certain scenarios that traditionally relied on the object keyword easier to write and maintain. In fact, the dynamic type uses the System.Object type under the hood, but unlike object it doesn’t require explicit cast operations at compile time, because it identifies the type at run time only:
  1. dynamic dynamicExample = 10;
  2. Console.WriteLine(dynamicExample.GetType());
This prints System.Int32.
In the following line, no cast is required, because the type is identified at run time only:
dynamicExample = dynamicExample + 10;
You can assign values of different types to dynamicExample:
dynamicExample = "test";
There’s a detailed blog post about differences between the object and dynamic keywords on the C# FAQ blog (bit.ly/c95hpl).
What sometimes causes confusion is that all of these keywords can be used together—they’re not mutually exclusive. For example, let’s take a look at this code:
  1. dynamic dynamicObject = new Object();
  2. var anotherObject = dynamicObject;
What’s the type of anotherObject? The answer is: dynamic. Remember that dynamic is in fact a static type in the C# type system, so the compiler infers this type for the anotherObject. It’s important to understand that the var keyword is just an instruction for the compiler to infer the type from the variable’s initialization expression; var is not a type.