Friday, 31 August 2012

Tech News - Indian cloud market to grow 70pc in 2012, over 2011


After being on the fringes for quite some time, cloud computing is set for a major leap. In these tough times, companies have been proactively looking at various 'disruptive technologies' that will ensure that technology is elastic enough to meet the business growth needs. Cloud models and the flexibility they bring are featuring high here. 

International Data Corporation (IDC) estimates the Indian Cloud market to be in the region of $535m in 2011, with a growth of more than 70 per cent expected for 2012 and almost 50 per cent growth forecasted for the next three years. It is a market that is fast maturing and seeing many new entrants with a broad range of investments/solutions taking key roles in the cloud ecosystem. Public cloud still lags way behind the private cloud adoption for a number of factors. 

IDC has just released a cloud research report, titled 'India Cloud Market Overview-2011-16'. The research provides insights on how the cloud market landscape is evolving and how companies are taking advantage of the new mode of IT usage. 

"We have definitely seen cloud cross the inflexion point in end 2011; use cases especially in IasS & SaaS areas provide testimony to that. With proper messaging from key vendors and due diligence of opportunities which exist in the cloud delivery models, the market will grow much faster in the coming years"" says Nirupam Chaudhuri, Research manager - Software & IT Services, IDC India, in a release. 

"Alliance with key channels and enablement will further intensify the growth for major cloud providers and gradually we will see even core applications moving to cloud much faster. Users need to feel much more comfortable with fewer inhibitions like security and ownership concerns" added Nirupam. 

Cloud providers also need to strengthen their capabilities to understand the business requirements of the organizations and come up with apt value propositions. "Organizations are more likely to work with firms that understand their business processes better and industry dynamics, and hence are better suited to overseeing the transition of the organization to a cloud environment without disruption of the business processes," saysSandeep Kumar Sharma, senior market analyst - IT services, IDC India. 

It is also imperative for the cloud providers to act as partners for the organizations in assessing their cloud readiness, and accordingly recommending a cloud adoption roadmap. This is absolutely essential for a seamless integration of the IT infrastructure into the cloud environment. "Organizations, even the larger ones, are on an increasing level feeling the pinching need to assess their cloud readiness and maturity levels. This would provide a boost to cloud consulting services in the coming 12-24 months. A direct corollary is that vendors need to have robust cloud consulting capabilities in place for making a foray into this space," Sandeep added. 


Tech News - Indian cloud market to grow 70pc in 2012, over 2011 | Techgig

Wednesday, 29 August 2012

Tech News - Rare Apple 1 computer sold from Steve Jobs‘ garage being auctioned | Techgig

Tech News - Rare Apple 1 computer sold from Steve Jobs‘ garage being auctioned | Techgig

Windows 8 Metro apps and the outside world

 In this blog I am sharing one of the new trend in technology world.

'Windows 8 Metro apps and the outside world: connecting with services and integrating the cloud


The blog attachment will covers the overview/discussion about the following :

       •Accessing data behind a service

       •Working with WCF and ASMX services

       •Working with REST services

       •Accessing oData services

       •Syndication with RSS

       •Authenticating with Twitter and Facebook using the WebAuthBroker

       •Using the Live SDK in your Windows 8 apps

       •Using roaming data in your applications

       •Working with sockets             
                –TCP sockets
                WebSockets

      •Setting the correct capabilities for network communication

I have attached the presentation by Gill Cleeren.




Topic summary: Windows 8 Metro style apps will give users a great experience. Apps promise the user to be alive and connected. Being connected means interfacing with services and the cloud. But what options do we have to make the connection to the outside world? 
In this discussion, we could get to know to explore how WinRT apps can connect with services (WCF, REST...) and the cloud to offer a great experience.


Hope this sharing content was useful.

Thanks & Regards
Prabhakaran S Pandian

Friday, 24 August 2012

Evolution of C# - Part I

Evolution of C#  - Part I

A quick reference about the evolution of c# , this blog will give an insight in C# 1.0,2.0,3.5,4.0.
The below image will give a overview sentence about the main features about the C# versions.



Evolution of C#

C# 2.0


Delegates


A delegate is a type-safe object that can point to another method (or possibly multiple methods) in the application, which can be invoked at later time.

Example:


using System; 


delegate string ConvertMethod(string inString); 


public class DelegateExample 


            public static void Main() 
            
                    // Instantiate delegate to reference UppercaseString method 
                    ConvertMethod  convertMeth = UppercaseString; 
                    string name = "Dakota";
                        
                    // Use delegate instance to call UppercaseString method 
                    Console.WriteLine(convertMeth(name)); 
             

             private static string UppercaseString(string inputString) 

             {
                    return inputString.ToUpper(); 
             } 
}


C# 2.0 Anonymous Delegates


Before C# 2.0, the only way to use delegates was to use named methods. In some cases, this results in forced creation of classes only for using with delegates. In some cases, these classes and methods are never even invoked directly.

C# 2.0 offers an elegant solution for these methods described above. Anonymous methods allow declaration of inline methods without having to define a named method. 
This is very useful, especially in cases where the delegated function requires short and simple code. Anonymous methods can be used anywhere where a delegate type is expected.

Anonymous Method declarations consist of the keyword delegate, an optional parameter list and a statement list enclosed in parenthesis.

Event Handler (without using anonymous methods)

public partial class Form1 : Form 
// This method connects the event handler. 
public Form1() 
InitializeComponent(); 
button1.Click += new EventHandler(ButtonClick); 
// This is the event handling method. 
private void ButtonClick(object sender, EventArgs e) 
MessageBox.Show("You clicked the button."); 
}

Event Handler (using anonymous methods)

public partial class Form1 : Form 
public Form1() 
InitializeComponent(); 

button1.Click += delegate(object sender, EventArgs e) 
// The following code is part of an anonymous method. 
MessageBox.Show("You clicked the button, and " + "This is an anonymous                                 method!"); 
}; 
}

One more example:

public partial class Form1 : Form 
{
public Form1() 
InitializeComponent(); 
// Declare the delegate that points to an anonymous method. 
EventHandler clickHandler = delegate(object sender, EventArgs e) 
MessageBox.Show("You clicked the button, and " + "This is an anonymous method!"); 
}; 
// Attach the delegate to two events. 
button1.Click += clickHandler; 
button2.Click += clickHandler; 
}


C# 2.0 Iterators


Iterator is one of the new feature in c# 2.0 which provide a way to create classes that can be used with foreach statement without implementing the IEnumerator & IEnumerable interfaces when compiler detects iterator it will automatically generate the current, MoveNext and dispose method of IEnumerable or IEnumerator interface.

foreach (item OrderItem in catalog) 
// (Process OrderItem here.) 
}



Enumerator e = catalog.GetEnumerator(); 
while (e.MoveNext()) 
OrderItem item = e.Current; 
// (Process OrderItem here.) 
}

one more example:

public class LinkInfo 
    { 
        public string FileName { get; set; }
        public string  LinkContent {  get; set;  } 
        public string  LinkStatus {  get; set;  }
        public string  NewLink {  get; set;  } 
    }

    public static IEnumerable<LinkInfo> GetLinksFromListView(ListView lstLinkList) 
    { 
        foreach (ListViewItem li in lstLinkList.Items) 
        {
            LinkInfo newLink = new LinkInfo(); 
            newLink.FileName = new string(li.Text.ToCharArray());
            newLink.LinkContent =  new string (li.SubItems[1].Text.ToCharArray()); 
            newLink.LinkStatus =  new string (li.SubItems[2].Text.ToCharArray()); 
            newLink.NewLink =  new string (li.SubItems[3].Text.ToCharArray()); 
            yield return newLink; 
        } 
    } 


C# 2.0 Partial Classes


Partial class was introduced in C#2.0 , it means that your class can be divied into multiple segments physically but at the time of compilation it will we grouped as a single entity.


// Stored in file MyClass1.cs 
public partial class MyClass 
public MethodA() 
{...} 

partial  public  MethodB(); 

// Stored in file MyClass2.cs 
public partial class MyClass
public MethodB() {...} 
}


C# 2.0 Generics


Generics is a most powerful feature in .net.Generics allow you to define type-safe classes,collections,remoting,arrays etc..this will improve the performance in your code and leads to a quality code.


public class ObjectList<ItemType> : CollectionBase

private ArrayList list = new ArrayList(); 

public int Add(ItemType value) 

return list.Add(value); 


public void Remove(ItemType value) 

list.Remove(value); 


public ItemType this[int index] 

get { return (ItemType)list[index]; } 
set { list[index] = value; } 

}




// Create the ObjectList instance, and 
// choose a type (in this case, string). 
ObjectList<string> list = new ObjectList<string>(); 

// Add two strings. 
list.Add("blue"); 
list.Add("green");

// The next statement will fail because it has the wrong type. 
// In fact, this line won't ever run, because the compiler
// notices the problem and refuses to build the application. 
list.Add(4);


C# 2.0 Generics constraints


ConstraintDescription
where T: structThe type argument must be a value type
where T: classThe type argument must be a reference type
where T: new( )The type argument must have a public default constructor
where T: <base class name>The type argument must be the base class name or derived from the base class name.
where T: <interface name>The type argument must be the interface or implement the interface. Multiple interfaces may be specified.


Hope this post is useful...
Will be concentrate on the C#3.0/3.5 & 4.0 in Part II.

Thanks & Regards
Prabhakaran S Pandian

Wednesday, 22 August 2012

Gender Selection in RadioBox Control with IValueConverter in WPF

Binding Gender in WPF Radiobutton Control


This is one of my interesting post , when answering to one of the Code project question I did this sample WPF application with Data grid and Radio box control to select the gender of the employee and the same I would like to share in the blog.

The question is here to select an employee from the Data grid and display the details in  Text box's and for gender with Radio button.Here the major part is to concentrate on the gender field.The below image shows the output.



With some of the Google leanings came up with a solution to have an enumeration value  for the gender field and using the IValueConverter interface. Use a ValueConverter combined with ConverterParameter to bind the enumeration to the boolean IsChecked of the radio button control.


The below is the code sample's:

XAML Code:



<Window x:Class="SampleWPFApp.GridWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Converters="clr-namespace:SampleWPFApp"
        Title="GridWindow" Height="300" Width="300">
    <Window.Resources>       
        <Converters:EnumBooleanConverter x:Key="EnumGender"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid DataContext="{Binding ElementName=PersonDatagrid,Path=SelectedItem}">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="30"></RowDefinition>                
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <TextBlock Name="Name" Grid.Row="0" Grid.Column="0" Text="Name" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBox Name="txtName" Grid.Row="0" Grid.Column="1" Height="20" Text="{Binding Name}"/>

            <TextBlock Name="txtgender" Grid.Row="1" Grid.Column="0" Text="Gender" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <RadioButton GroupName="male" Content="Male" Height="16" Margin="1,5,0,0" Name="MaleRadioButton" VerticalAlignment="Top"  Grid.Column="1" HorizontalAlignment="Left" Width="42" Grid.Row="1" 
                         IsChecked="{Binding Converter={StaticResource EnumGender},Path=Gender,Mode=TwoWay,ConverterParameter=Male}"/>
            <RadioButton GroupName="female" Content="Female" Height="16" HorizontalAlignment="Left" Margin="56,5,0,0" Name="FemaleRadioButton" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" 
                         IsChecked="{Binding Converter={StaticResource EnumGender},Path=Gender,Mode=TwoWay,ConverterParameter=Female}"/>
        </Grid>

        <DataGrid AutoGenerateColumns="False"  Height="200" HorizontalAlignment="Left" Grid.Row="1" Margin="0,12,0,0" Name="PersonDatagrid" VerticalAlignment="Top">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Width="100" Binding="{Binding Name}"/>
                <DataGridTextColumn Header="Gender" Width="150" Binding="{Binding Gender}"/>               
            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</Window>

Codebehind code for the XAML page:


namespace SampleWPFApp
{
    /// <summary>
    /// Interaction logic for GridWindow.xaml
    /// </summary>
    public partial class GridWindow : Window
    {
        public GridWindow()
        {
            InitializeComponent();
            PersonDatagrid.ItemsSource = new List<PersonalInfo> { 
                new PersonalInfo { Gender =  Genders.Female , Name = "Mariya"},
                new PersonalInfo { Gender = Genders.Male , Name = "Martin"},
                new PersonalInfo { Gender =  Genders.Female , Name = "Jermila"},
                new PersonalInfo { Gender = Genders.Male , Name = "Chand"}};
        }
    }

    public class PersonalInfo
    {
        public string Name { get; set; }
        public Genders Gender { get; set; }
    }

    public enum Genders
    {
        Male = 1,
        Female
    }
}


Converter code for the control:



public class EnumBooleanConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var ParameterString = parameter as string;
            if (ParameterString == null)
                return DependencyProperty.UnsetValue;

            if (Enum.IsDefined(value.GetType(), value) == false)
                return DependencyProperty.UnsetValue;

            object paramvalue = Enum.Parse(value.GetType(), ParameterString);
            return paramvalue.Equals(value);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var ParameterString = parameter as string;
            if (ParameterString == null)
                return DependencyProperty.UnsetValue;

            return Enum.Parse(targetType, ParameterString);
        }

        #endregion
    }




Hope this blog post will be useful.

Thanks & Regards
Prabhakaran Soundarapandian