Exception handling in the .NET Task Parallel Library with C#: reading task properties

We saw in this and this post how to catch and handle exceptions thrown by threads. A task has properties that let you read its state and determine what happened to it.

Read more of this post

Handling claims transformation in an OWIN middleware in .NET MVC part 2


In the previous post we laid the foundations for this short series. We went through a refresher of claims and OWIN and started building a simple ASP.NET MVC web project to investigate what’s available about the user of the current thread in a controller. We saw that by default the only claim available about a user might be their name, unless they are anonymous of course.

In this post we’ll continue to explore claims of authenticated users.

Read more of this post

Python language basics 55: items and values in a dictionary


In the previous post we saw how to copy a set. Both the copy function and the set constructor create shallow copies with all its consequences.

In this post we’ll discuss how to retrieve and iterate over the keys and values of a dictionary.

Read more of this post

Python language basics 54: how to copy a set


In the previous post we looked at some basic operations from the world of boolean set algebra supported in Python: subset, superset and disjoint. We saw how Python supported these operations natively with built-in functions and also looked at examples which tested them.

In this post we’ll look at 2 ways to create a copy of a set.

Read more of this post

How to change the colours in a .NET console application

Sometimes you need to change the fore- and background colours in your .NET console application. Normally it’s fine with the traditional black background and white foreground colours – or whatever the user has set as default colours – however, some message types may deserve extra attention.

This short post will demonstrate how to change the colours in a console application.

Read more of this post

Handling claims transformation in an OWIN middleware in .NET MVC part 1


Claims have become widespread in software projects to tighten the security aspects of an application. We looked at claims before on this blog – see the link in the next paragraph – but time goes by and new features have been added to this technology lately. This is especially true as far as OWIN is concerned. In this mini-series we’ll concentrate on a very narrow aspect of claims in .NET MVC: claims transformation in OWIN middleware.

Read more of this post

Continuation tasks in .NET TPL: a simple continuation example

Tasks in .NET TPL make it easy to assign tasks that should run upon the completion of another task.

We’ll need a basic object with a single property:

public class Series
	public int CurrentValue

Declare a task that increases the CurrentValue in a loop and return the Series. This task is called the antecedent task.

Task<Series> motherTask = Task.Factory.StartNew<Series>(() =>
	Series series = new Series();
	for (int i = 0; i < 10000; i++)
	return series;

Declare the continuation task where we also use the antecedent as method parameter:

motherTask.ContinueWith((Task<Series> previousTask) =>
	Console.WriteLine("Final Balance: {0}", previousTask.Result.CurrentValue);

The antecedent task will then schedule the continuation task for you. If there are other tasks then they may run before or after the continuation tasks depending on the task scheduler.

View the list of posts on the Task Parallel Library here.


A great WordPress.com site

iReadable { }

.NET Tips & Tricks

Robin Sedlaczek's Blog

Love to use Microsoft Technologies

HarsH ReaLiTy

A Good Blog is Hard to Find

Ricos Blog zu Softwaredesign- und architektur

Ideen und Gedanken rund um Softwaredesign und -architektur, Domain-Driven Design, C# und Windows Azure

the software architecture

thoughts, ideas, diagrams,enterprise code, design pattern , solution designs

Technology Talks

on Microsoft technologies, Web, Android and others

Software Engineering

.NET, SQL and Mobile

Disparate Opinions

Various tidbits

chsakell's Blog

Anything around ASP.NET MVC,WEB API, WCF, Entity Framework & C#

Cyber Matters

Bite-size insight on Cyber Security for the not too technical.

Guru N Guns's

OneSolution To dOTnET.

Johnny Zraiby

Measuring programming progress by lines of code is like measuring aircraft building progress by weight.


Get every new post delivered to your Inbox.

Join 809 other followers

%d bloggers like this: