Kinect and Reactive Extensions (Rx)

Kinect and Reactive Extensions (Rx) are made for each other – one pumps events and the other one handles them. I was working on a WPF application using Kinect. One of the screens have to (a) track the user in front and show him/her in motion more like an infrared image, (b) show a ticking timer and (c) track the skeletion points and continously compute angles and apply some business logic. Too much for one screen! Doing everything in the UI thread will be a disaster and I was in need of more threads to handle these things but ultimately the end result of all the processing is UI getting updated. Doing this by creating my own threads will result in sub-optimal code. Rx to the rescue.

Continue reading

Digest Authentication with ASP.NET Web API (Part 1)

We have seen basic authentication in one of my previous posts. Basic authentication is simple. It just sends the user credentials in the HTTP header. If HTTPS is not used, the credentials will be available for every one to see. ASP.NET Web API that uses basic authentication can be tested through the browser itself. When the browser makes a GET request, it first gets a 401 response with WWW-Authenticate : Basic header. No body knows HTTP better than a web browser! So, my browser now knows that it has to send the credentials in the HTTP header using basic scheme. So, my browser, IE in this case, pops up a dialog, gets the credentials, packages the sameĀ  in the correct format and sends it to the server. Continue reading

Build Your Own SQL Express Query Tracer Visual Studio Add-in

SQL Server Express is free and ideal for development purposes. When a developer exclusively uses the SQL instance, there is tighter control over the queries executed and there is no real need for a tool to trace the queries. This is typically the case, when the developer hand codes the queries. However, the situation is different when an ORM like Entity Framework is used. There are times when a developer has to understand the queries generated by the EF. Regular SQL Server comes with a profiler but unfortunately SQL Express lacks the same. It is a problem but can be easily solved. Continue reading