Wednesday, October 10, 2012

Dark Visual Experience in Visual Studio 2012

I have written whole series related to Visual Studio 2012 features and this post will also be part of same series.You can get all my post related to visual studio from the following link.

Visual Studio 2012 feature series

Before some days I was searching something and found a great way to change the visual experience of visual studio 2012. I found that there are two type of themes available in visual studio 2012 light and dark under Tools->Option-> General environment value. This is one of newest feature I have found in visual studio 2012.

Dark Visual Experience in Visual studio 2012- A new visual studio feature.
Share:
Wednesday, September 12, 2012

Tips for increasing Alexa rank of your technical blog

Today I am not writing any technical post. This post is out of subject for this technical blog. But the intension of this blog to reach more and more people to help community so I am writing this. In this post I am going to explain few tips for improving Alexa rank for your technical blog.

What is Alexa Rank?


Alexa.com is a private company founded in 1996. They defined themselves as the “Web information company”. But in simple words for us Alexa is a company that measures web traffic in almost every site on the internet through their toolbar plugin. On the internet Alexa rank becomes a standard in the webmasters world. If you have good Alexa ranking then there will more people,advertisers,sponsors and visitors will be attracted your site.

Tips for increasing Alexa rank on your technical blog:


I am not kind of guru on this. I am just sharing what I have learnt from the experience. Followings are few tips that will help you increasing Alexa rank.

  1. First thing I need to clear that alexa rank and google page rank are both different. So If you are having higher page rank that does not mean that you will have higher Alexa rank. Both are measured in different way.
  2. To have perfect Alexa rank first thing you need to is to claim your site at Alexa.com. You can claim your site via putting a meta tag suggested by them. That way Alexa.com can access your site better and you could have possibly better and accurate rank over there.
Share:
Saturday, September 8, 2012

Predicate delegate in C#

I am writing few post on different type of delegates and this post also will be part of it. In this post I am going to write about Predicate delegate which is available from C# 2.0. Following is list of post that I have written about delegates.

  1. Delegates in C#.
  2. Multicast delegates in C#.
  3. Func delegate in C#.
  4. Action delegate in C#.

Predicate delegate in C#:

As per MSDN predicate delegate is a pointer to a function that returns true or false and takes generics types as argument. It contains following signature.

Predicate<T> – where T is any generic type and this delegate will always return Boolean value. The most common use of a predicate delegate is to searching items in array or list. So let’s take a simple example. Following is code for that.
Share:
Thursday, September 6, 2012

Action delegates in C#

In last few posts about I have written lots of things about delegates and this post is also part of that series. In this post we are going to learn about Action delegates in C#.  Following is a list of post related to delegates.

  1. Delegates in C#.
  2. Multicast Delegates in C#.
  3. Func Delegates in C#.

Action Delegates in c#:

As per MSDN action delegates used to pass a method as parameter without explicitly declaring custom delegates. Action Delegates are used to encapsulate method that does not have return value. C# 4.0 Action delegates have following different variants like following. It can take up to 16 parameters.

  • Action – It will be no parameter and does not return any value.
  • Action(T)
  • Action(T1,T2)
  • Action(T1,T2,T3)
  • Action(T1,T2,T3,T4)
  • Action(T1,T2,T3,T4,T5)
  • Action(T1,T2,T3,T4,T5,T6)
  • Action(T1,T2,T3,T4,T5,T6,T7)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)
  • Action(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16)
Share:
Wednesday, September 5, 2012

Incremental search in Visual Studio

Visual studio is a Great IDE and there are still lots of feature that not known to developers. Incremental search is one of them. This is a amazing feature to find code in particular document and its available from Visual Studio 2010 and carried over in Visual Studio 2012. Incremental search allows developers to search in document without blocking UI and allow to search as they type.

Interesting!! right.. So let’s open visual studio and see how it works. Once you open Visual Studio and press Ctrl + I and type something it will find the string without blocking your visual studio UI. Just like following.

Incremental Search in Visual Studio
Share:
Saturday, August 25, 2012

Func Delegate in C#

We already know about delegates in C# and I have previously posted about basics of delegates in C#. Following are posts about basic of delegates I have written.

Delegates in C#
Multicast Delegates in C#

In this post we are going to learn about Func Delegates in C#. As per MSDN following is a definition.

“Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.”

Func can handle multiple arguments. The Func delegates is parameterized type. It takes any valid C# type as parameter and you have can multiple parameters as well you have to specify the return type as last parameters.

Followings are some examples of parameters.
Func<int T,out TResult>
Func<int T,int T, out Tresult>

Now let’s take a string concatenation example for that. I am going to create two func delegate which will going to concate two strings and three string. Following is a code for that.

using System;
using System.Collections.Generic;

namespace FuncExample
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string, string, string> concatTwo = (x, y) => string.Format("{0} {1}",x,y);
            Func<string, string, string, string> concatThree = (x, y, z) => string.Format("{0} {1} {2}", x, y,z);

            Console.WriteLine(concatTwo("Hello", "Jalpesh"));
            Console.WriteLine(concatThree("Hello","Jalpesh","Vadgama"));
            Console.ReadLine();
        }
    }
}

Share:
Friday, August 24, 2012

What is Inversion of control and why we need it?

Most of programmer need inversion of control pattern in today’s complex real time application world. So I have decided to write a blog post about it. This blog post will explain what is Inversion of control and why we need it. We are going to take a real world example so it would be better to understand.

The problem- Why we need inversion of control?


Before giving definition of Inversion of control let’s take a simple real word example to see why we need inversion of control. Please have look on the following code.

public class class1
{
    private class2 _class2;

    public class1()
    {
       _class2=new class2();
    }

}
public class class2
{
     //Some implementation of class2
}

I have two classes “Class1” and “Class2”.  If you see the code in that I have created a instance of class2 class in the class1 class constructor. So the “class1” class is dependent on “class2”. I think that is the biggest issue in real world scenario as if we change the “class2” class then we might need to change the “class1” class also. Here there is one type of dependency between this two classes that is called Tight Coupling. Tight coupling will have lots of problem in real world applications as things are tends to be change in future so we have to change all the tight couple classes that are dependent of each other. To avoid this kind of issue we need Inversion of control.
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews