Home | Blog | Publications | Photos | Services | About | Contact

Blog Archive - July, 2009

Back to Blog index.

Fri, 31 Jul 2009 18:08:11 GMT:
ASP.NET MVC version 2 first preview available

Continuing the topic of new summer releases: the ASP.NET MVC version 2 Preview 1 is now here! As with many ASP.NET releases before, ScottGu's blog is probably the best place to start learning. This time, he gives a nice and through introduction to the new version.

As you might guess, the new features planned to ASP.NET MVC 2 are many, and at this point the new attributes, area support (multiple ASP.NET projects in a single unified solution) and more efficient helpers sound the most interesting to my ear. Go and download your preview copy today; it exists nicely along with ASP.NET MVC 1.0.

Wed, 29 Jul 2009 19:27:14 GMT:
Windows Azure SDK updated

If you are interested in cloud computing, development for these environments, and Windows Azure, then you are surely happy to learn that Microsoft just recently updated their Windows Azure SDK (Software Development Kit) with the July 2009 version.

You can download the new SDK kit here. One particularly interesting new piece is this: "the new PowershellRole sample hosts the Powershell runtime within a Windows Azure role."

At around a 4 MB in size, this is one of those packages with a great weight-to-bits ratio.

Sun, 26 Jul 2009 16:28:49 GMT:
Where to find Windows 7 sample code?

Some developers have contacted me and asked from where they could find examples on how to use the new Windows 7 features from code. Although MSDN contains tidbits of code (I'm sure more will follow in the future), some developers enjoy full example applications better.

With that in mind, and especially so if you are using C# or .NET, I suggest downloading the Windows API Code Pack for .NET, which contains first and foremost easy interfaces to Windows 7 (and Windows Server 2008 R2) features to managed code developers, but also a nice set of different sample applications.

So, if you are looking for sample code in C#, go and download the Code Pack today. Good luck!

Thu, 23 Jul 2009 14:41:20 GMT:
Windows 7 and Windows Server 2008 R2 are ready

Microsoft announced yesterday that Windows 7 and Windows Server 2008 R2 have been released to manufacturing (RTM). This means that the final bits are soon becoming available to MSDN and Technet subscribers, volume customers, and later on the general public. MSDN subscribers should get the bits in about two weeks, on August 6th, and the general public on October 22nd. Sounds great to have the new versions of Windows ready!

The difficult part now is to wait until the MSDN release. Luckily, the RC version still works, and time can also be spent for example on the new Thrive site, aimed at independent software vendors.

Happy reading, the wait should soon be over!

Wed, 22 Jul 2009 14:44:21 GMT:
Password masking with stars, good or bad?

Almost all users are aware of hiding password characters with stars or other such characters. But is this ubiquitos practice actually good? Jakob Nielsen argues that it isn't (always).

So as developers, which route should we choose: hide the password characters as always, or not hide them on the promise of better-quality passwords? Actually I believe the user should have a choice: let the user decide! From my day-to-day routine I can give one example: try WinZip's latest versions and try to encrypt or decrypt an archive. You are given the option. Maybe you should, too?

Sun, 19 Jul 2009 10:13:43 GMT:
New from SysInternals: ProcDump

Although mainly aimed at IT administrators, the free SysInternals tools are invaluable for developers as well. I've solved countless problems with tools like Process Monitor (ex FileMon/RegMon), TCPView and DebugView. From time to time, the fellows at SysInternals come up with new tools, and this time they've invented ProcDump.

With ProcDump, you can create a dump from any running process that hogs the CPU. Says the documentation: "ProcDump is a command-line utility whose primary purpose is monitoring an application for CPU spikes and generating crash dumps during a spike that an administrator or developer can use to determine the cause of the spike."

Of course, such dumps have been available for a long time, and especially if you are able to do just-in-time (JIT) debugging with your favorite development tool, then you won't need anything more. But usually, the problems occur at the production sites, which are always far away from the convenience of your own desktop and tools.

In these sitations ProcDump can become very valuable. Be sure to check it out.

Fri, 17 Jul 2009 14:54:50 GMT:
My newest screencast about Live/Bing Maps programming with C# available

Developer.com has just recently published my latest screencast about Bing Maps (ex Live Maps) and programming them from ASP.NET/C# applications.

The video is available here and runs for 6:06 minutes.

Hope you like it!

Wed, 15 Jul 2009 16:31:09 GMT:
Windows Azure prices revealed

Just few days ago, Microsoft finally announced the pricing of its cloud computing platform, Azure. Personally, I've long waited for this information to become available, and now it is finally online. Here is a quick summary of the pricing in USD:

Windows Azure

SQL Server databases

At this point, I'm not sure how every thinkable scenario will be calculated. For instance, I'm not 100% certain how the computing time is calculated, but I assume that it's the time your Azure application is deployed and available, and not the number of hours the application(s) consume a hour's worth of CPU time.

Even with these uncertainties, I wanted to have a quick idea of the price level. Let's assume a simple web application that needs to access a small SQL database, and that storage requirements are modest: in the range of 2-3 gigabytes, and that the 1 GB SQL database would be plenty. If the usage of the application is also light, say, 5 to 10 gigabytes of traffic per month (50% in, 50% out), and the SQL bandwidth would be 4 GB in total, the calculations reveal the following:

So, for about $100 per month, you could have a hosted web application with an SQL server database and extensible computing power whenever you need it. If you compare Azure's pricing to certain web hosting providers, like DiscountASP.NET which I'm using for Nimacon, you can get a similarly specified site for around $15 per month.

Time will tell what becomes of Azure, but if you need configurable computing power (something you cannot do with web hosts) and support for applications beyond simple ASP.NET web applications, then Azure might be your choice. I'm waiting till November to see how Azure picks up and what kind of applications are running there.

Tue, 14 Jul 2009 14:54:23 GMT:
Using Memory-Mapped Files in .NET 4.0

Developer.com has today published my newest .NET development article. This time, the focus is on .NET 4.0 and memory mapped files. The article, titled "Using Memory-Mapped Files in .NET 4.0" is available on the site.

Enjoy!

Sat, 11 Jul 2009 18:02:38 GMT:
Expression 3 and Silverlight 3

Yesterday, Microsoft announced the availability of both Silverlight 3 and Expression 3 suite of products. Quickly put, Silverlight 3 brings us better HD video and hardware accelerated 3D features among other things, and Expression 3 IntelliSense support for C# (cool!), Team Foundation Server (TFS) support for enterprise-scale development processes, and Sketchflow, a new rapid visualization tool. So a worthwhile release without doubt. I haven't yet checked whether these new bits are already available on MSDN, but they surely will soon.

The main launch site is called See The Light which contained a nice countdown animation prior to the launch moment.

Tue, 07 Jul 2009 14:41:31 GMT:
A code snippet to connect to SQL Server's Northwind sample database

As I'm often running demos at seminars and customer meetings, I find myself writing the same and same snippets of code all over again. Although I've moved to ADO.NET Entities quite extensively for accessing SQL data, I still need quite often to demonstrate a quick data access to for example SQL Server, and just fetch a records or two from a sample database.

Most often, I'm using the old Northwind sample database (which is more or less replaced by AdventureWorks, but I find Northwind to be simpler and easier to grasp for quick demos), which contains a basic sales model with customers and orders that everybody understands.

Now, I quite often write code to take a customer ID, and fetch the company name based on the ID. This is trivial with SQLConnection and SQLCommand classes, but the work gets repetitive at best. In case you find yourself in a similar situation, then feel free to copy and paste the following C# code (tested with Visual Studio 2008):

using System.Data.SqlClient;
...
public static string GetCustomerDetails(
  string customerId)
{
  string connStr = "Data Source=myserver;"+
    "Initial Catalog=Northwind;"+
    "Integrated Security=True";
  SqlConnection conn = new SqlConnection(
      connStr);
  try
  {
    conn.Open();
    string sql = "SELECT * " +
        "FROM [customers] " +
        "WHERE [customerid] = @custid";
    SqlCommand cmd = new SqlCommand(
        sql, conn);
    cmd.Parameters.AddWithValue(
        "@custid", customerId);
    try
    {
      SqlDataReader reader =
          cmd.ExecuteReader();
      try
      {
        if (reader.Read())
        {
          string company =
              reader.GetString(1);
          return company;
        }
      }
      finally
      {
          reader.Dispose();
      }
    }
    finally
    {
        cmd.Dispose();
    }
  }
  finally
  {
      conn.Dispose();
  }
  return null;
}

As you can see, the code is very easy to follow, and basically all you need to do is change the connection string and make sure you have the Northwind sample database installed (I mostly create it using a custom SQL script that I've created by extracting it from an existing Northwind database). And true, the code could be made shorted for instance using C#'s using statements, but the point here is to create quick code and not necessarily show the best practices.

Hope this helps!

Sun, 05 Jul 2009 16:24:18 GMT:
Finding the "Submit URL" link for Bing

If you've been following Microsoft's search engine battle against Google, then you surely have heard of Bing, the new name for Live Search. Recently, I needed to submit a site for Bing, but it actually proved to be a bit difficult to add a new URL for Bing to crawl.

Of course, the link was available once you found our way. In case you are faced with a similar situation, I thought I'd share the link I've found. So, to submit your site to Bing, use the following link:

http://www.bing.com/docs/submit.aspx

From there, you can easily add one of more sites to the decision engine. And as for reference, here are the similar links to Google and Yahoo! search:

Good luck!

Fri, 03 Jul 2009 14:55:38 GMT:
New article published about TPL and PLINQ

Developer.com has published my latest article about the new parallel features in .NET 4.0: Task Parallel Library and PLINQ (Parallel LINQ). The article is titled "Going Parallel with the Task Parallel Library and PLINQ" and available here.

This article shows how you can use these new framework features in your own code, and also briefly discusses how Visual Studio 2010 will support there new features.

Enjoy!

Wed, 01 Jul 2009 18:27:35 GMT:
Oracle support becomes deprecated in ADO.NET 4.0

In the fortcoming .NET version 4.0, Microsoft has decided to deprecate the ADO.NET classes to access Oracle databases. Shortly put, this means that you can continue to use the System.Data.OracleClient namespace and the classes there, but in a future .NET version (5.0?) they will become obsolete and not available.

What Microsoft now recommends is that developers wanting to access Oracle databases would switch to third-party libraries. Of course, this will mean that you need to rewrite parts of your code; this is just a good refresher to us all: don't rely that certain libraries are there forever. Instead, make sure you isolate your database access to certain classes and/or write appropriate wrappers around them, so you don't need to rewrite your whole application.

Although this a quite unfortunate decision, I'm not sure it was an easy one for Microsoft. More details can be found from the ADO.NET team blog.

 

› Blog Archive