One of the first things you would need to be vary of while working with Iterator methods and async methods is exception handling. Both Iterator methods and async methods delay the execution of your code, right until you need the result, but it also results in delayed exceptions. Late Exception With Iterator Methods Let's consider … Continue reading Early Exceptions for Iterator and async Methods
Tag: IEnumerable
IEnumerable.Shuffle Implementation
Following code is an implementation of Shuffle method on IEnumerable based on the Durstenfeld modification of Fisher Yates Shuffle algorithm, a simple and efficient method. More information on the algorithm can be found in Wiki. The complete code can be found in Github
Linq Recipes : IsIncreasing/IsDecreasing & IsAlternating
LINQ, ever since its introduction has turned out to be one of the favorite tools for .Net Developers. The post focus on couple of quick recipes for common scenarios. Scenario 001 You have a collection of objects and you would like verify if the collection is sorted in increasing/decreasing order. Recipe We could always sort … Continue reading Linq Recipes : IsIncreasing/IsDecreasing & IsAlternating