Monthly Archives: November 2010

Standard LINQ example of joining elements of the list into the string

int[] array1 = { 1, 2, 3, 4 };
var result1 = array1.Select(elem => elem.ToString())
                   .Aggregate((first, second) => first + “, ” + second);

may be reimplemented by StringBuilder like

var result2 = array1
    .Select(elem => elem.ToString())
        new StringBuilder(),
          (sb, s) => {
              if (sb.Length > 0)
                  sb.Append(“, “);
              return sb;
        sb => sb.ToString());

Some days ago I created interactive charts in admin interface of our game project.
I tried 3 different techniques:

  • Standard MS Chart for .NET 3.5. There is MS Chart for .NET 4.0 as well, but we use 3.5 for now. Those charts generated by special handler as images on the page. There are a lot of chart types.
  • Pure HTML table with elements with different (%) width. This is the most interesting way if you need just simple diagram because you can control everything regarding your diagram. It doesn’t need special infrastructure.
  • Fusion Chart. It uses flash. There are free version and evaluation one but without trial period. Evaluation label is displayed only. I get data for the chart as XML by special .ashx handler.

For this application we decide to use Fusion Chart.