Free Ebooks from Syncfusion

Syncfusion is offering a really nice collection of ebooks : the “Succintly” collection

What is really great is that they are covering most of popular technologies and that there is not too much to read : each book contains about 100 pages

Currently the collection is:

  • Localization for .NET Succinctly
  • MATLAB Succinctly
  • NHibernate Succinctly
  • PowerShell Succinctly
  • Android Programming Succinctly
  • Entity Framework Code First Succinctly
  • MongoDB Succinctly
  • R Succinctly
  • Neural Networks Using C# Succinctly
  • HDInsight Succinctly
  • LightSwitch Mobile Business Apps Succinctly
  • BI Solutions Using SSAS Tabular Model Succinctly
  • Twitter Bootstrap Succinctly
  • AngularJS Succinctly
  • Visual Studio 2013 Succinctly
  • Windows Phone 8 Development Succinctly
  • Node.js Succinctly
  • Direct3D Succinctly
  • SQL Server Analysis Services Succinctly
  • Assembly Language Succinctly
  • ASP.NET Web API Succinctly
  • Visual Studio Add-Ins Succinctly
  • Postgres Succinctly
  • Direct2D Succinctly
  • Windows Azure SQL Reporting Succinctly
  • Unit Testing Succinctly
  • TypeScript Succinctly
  • WPF Succinctly
  • iOS Succinctly
  • Windows Store Apps Succinctly
  • Data Structures Succinctly Part 2
  • GIS Succinctly
  • Data Structures Succinctly Part 1
  • Objective-C Succinctly
  • F# Succinctly
  • Knockout.js Succinctly
  • C++ Succinctly
  • ASP.NET MVC 4 Mobile Websites Succinctly
  • LightSwitch Succinctly
  • JavaScript Succinctly
  • HTTP Succinctly
  • PDF Succinctly
  • Git Succinctly
  • jQuery Succinctly

You can find them here : http://www.syncfusion.com/resources/techportal/ebooks

Print a Kendo UI grid with pagination

So I wanted to print a page that has a Kendo ui grid with pagination activated, but I didn’t want to remove the pagination on the page.

I found those two posts that helped me

http://www.telerik.com/forums/print-all-pages-in-a-grid

http://stackoverflow.com/questions/18325025/how-to-detect-window-print-finish

And I ended with this


(function () {

var pageSize = 0;
 var beforePrint = function () {

 // remove paging on grid
 if ($(".k-grid").length > 0) {
 var dataSource = $(".k-grid").data("kendoGrid").dataSource;
 pageSize = dataSource.options.pageSize; // save the current page size
if(pageSize !== undefined){
 dataSource.pageSize(dataSource.total()); // set the size to the number of items
}
 }

};

var afterPrint = function () {

// set paging back
 if ($(".k-grid").length > 0 && pageSize > 0) {
 var dataSource = $(".k-grid").data("kendoGrid").dataSource;
 dataSource.pageSize(pageSize);
 }
 };

// chrome
 if (window.matchMedia) {
 var mediaQueryList = window.matchMedia('print');
 mediaQueryList.addListener(function (mql) {
 if (mql.matches) {
 beforePrint();
 } else {
 afterPrint();
 }
 });
 }

// FF & IE
 //https://developer.mozilla.org/en-US/docs/Web/API/window.onbeforeprint
 window.onbeforeprint = beforePrint;
 window.onafterprint = afterPrint;

}());

Hope it helps someone

ASP.NET vNext

A few resources about ASP.NET vNext

Intro by Scott Hanselman : http://www.hanselman.com/blog/IntroducingASPNETVNext.aspx

Intro by David Fowler : http://davidfowl.com/asp-net-vnext/

  • A better platform for building web applications with .NET
  • Things we wanted to fix
  • System.Web

Overview by David Fowler : http://davidfowl.com/asp-net-vnext-architecture/

Intro by Jeff Fritz: http://developer.telerik.com/featured/microsofts-special-k-an-introduction-to-asp-net-vnext/

  • Introducing OWIN
  • MVC – Meet WebAPI, WebAPI meet MVC
  • Bye Bye System.Web
  • Blistering Performance
  • Where is web.config?
  • Welcome Project.JSON!

Videos :

Scott Hanselman and Scott Hunter : INTRODUCING: The Future of .NET on the Server

David Fowler and Scott Hanselman : DEEP DIVE: The Future of .NET on the Server

 

Source code :

Asp.Net vNext is open source and can be found on github : https://github.com/aspnet

The current version of ASP.NET is still on codeplex : http://aspnetwebstack.codeplex.com/

Know your .NET Framework Episode 2 : getting a range of integers

If you need a list of integers filled with all numbers in a specific range, you will often do this :

List<int> range = new List<int>();
for (int i = rangeStart; i < RangeEnd; i++)
{
   range.Add(i);
}

or you will write a method

public IEnumerable<int> GetRange(int start, int end)
{
  for (int i = start; i < end; i++)
  {
    yield return i;
  }
}

and call it:

List<int> range = GetRange(0, 10).ToList();

Good news : this method already exists in the framework !

You can find it in the System.Linq namespace : it’s the Enumerable.Range static method, and it’s available since framework 3.5.

This method returns an IEnumerable<int>, you can use it like this, or convert it to an array or a list.
to use it :
List<int> range = new List<int>(Enumerable.Range(0, 10));
or
List<int> range = Enumerable.Range(0, 10)).ToList();

Remark

Note that the first parameter is the start, but the second is not the end ! it’s a count !, so if you want to use it by specifying a start and an end you will have to do this :

int start = 5;
int end = 50;
List<int> range = Enumerable.Range(start, (end-start)+1)).ToList();

It’s handy to reduce the code size when you want to fill a dropdown or other things that requires a range of integers.