Tag Archives: Programming

Matlab as a programming language

By

Matlab has long proclaimed itself as “The language of technical computing”. However its language leaves a lot to be desired.

Having worked with Matlab on and off for a number of years now, I am going to try and explain what could be improved:

The Future of C# and Visual Basic

By

The videos from PDC, Microsoft’s Professional Developers Conference back in October are now online.

One of the most interesting videos is Anders Hejlsberg, a technical fellow at the developer devision in Microsoft, talking about asynchronous programming and how it will be integrated with the new versions of C# and VB coming out soon.

The team are tackling the asynchronous programming problem head-on and introducing some very clean syntax for quickly and easily dealing with code blocks you would like to handle asynchronously without requiring threading. Interestingly, this functionality can deliver some great speed improvements in ASP.NET web applications too (especially when calling external services) as well as on the client.

Check out the video below for a great introduction to asynchrony in C# 5.

Team Foundation Server for Students

By

Team Foundation Server is a product that Microsoft have been selling to work with Visual Studio for many years now. Over time it has evolved, and with the upcoming release of Visual Studio 2010, I thought now would be a great time to check out Team Foundation Server in more detail; specifically how it can help students get their projects done faster and better.

Team Foundation Server used to be the companion to Visual Studio Team System (which acted as the client). With VS 2010, Team System has been integrated into the core of Visual Studio. This provides two benefits – better support as it’s baked right in, and more students can get access to it for free!

There are 3 main targets of Team System:

Visual Studio 2010 Beta

By

Following on from my recent post on Office 2010, I thought I’d get on and try the latest piece of beta software that Microsoft has unleashed upon its users.

Visual Studio 2010 is the latest version of Microsoft’s application development workhorse; with it comes version 4 of the .NET Framework, and a whole raft of improvements that developers have long been calling out for.

Visual Studio 2010 Logo

HTTP Authorisation in C#

By

I’ve been doing some work on a super-secret project recently that involves C# and web APIs. As part of this, most of the API calls require HTTP  Basic authorization. This is fairly easy to do, as in C# using a WebClient object you just do this:


WebClient client = new WebClient();

client.Credentials = new NetworkCredentials("username", "password");

client.DownloadFile("http://api.file.here/get.json", "D:\Stuff\Location.doc");

However, the credentials are only sent when the server challenges for authorisation – if it doesn’t explicitly challenge then the credentials aren’t sent. The way around this is to set the header yourself using this little snippet:


WebClient client = new WebClient();

string authInfo = this.credentials.UserName + ":" + this.credentials.Password;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
client.Headers["Authorization"] = "Basic " + authInfo;

client.DownloadFile("http://api.file.here/get.json", "D:\Stuff\Location.doc");