# Monday, 29 March 2010

Repairing Outlook 2007 .pst file

I just had a little scare with Outlook. After installing VSTO 2010 beta 2 64bit on my system my Calendar folder was suddenly corrupt. Luckily there is an excellent (free) way of repairing a broken .pst file. It’s just a little hidden. Read this KB article to find out how to do it.

Tip to Microsoft: Why not register this file as an “Repair” option to a .pst file, allowing me to right-click and fix my broken .pst file?

#    Comments [0] |
# Thursday, 25 March 2010

Upload a file using FTPS

I just implemented a little routine to upload a file to an FTP site using SSL. I started looking at purchasing a component to help me out, but it turns out the .NET Framework offers all you need.

public class FtpStatus
{
    public FtpStatus()
    {
        Succes = true;
    }
 
    public bool Succes { get; set; }
    public string Message { get; set; }
}
 
/// <summary>
/// Upload a file using FTP and SSL.
/// </summary>
/// <param name="host">Full name without the 's', e.g.  ftp://secure.develop-one.com</param>
/// <param name="filename">Filename including server path, e.g.  /Upload/test.txt</param>
/// <param name="file"></param>
public FtpStatus UploadFile( string host, bool useSsl, string username, string password, string filename, byte[] file )
{
    FtpStatus result = new FtpStatus();
 
    string target = host + filename;
    FtpWebRequest request = (FtpWebRequest) FtpWebRequest.Create( target );
    request.EnableSsl = useSsl;
    request.KeepAlive = true;
    request.UseBinary = true;
    request.UsePassive = true;
    request.Method = WebRequestMethods.Ftp.UploadFile;
 
    request.Credentials = new NetworkCredential( username, password );
 
    try
    {
        using ( Stream stream = request.GetRequestStream() )
        {
            stream.Write( file, 0, file.Length );
            stream.Close();
        }
    }
    catch ( System.Net.WebException exception )
    {
        result.Succes = false;
        string message = ( (System.Net.FtpWebResponse) ( exception.Response ) ).StatusDescription.Replace( "\r\n", "" );
        if ( message.IndexOf( ":" ) > 0 )
        {
            message = message.Substring( message.IndexOf( ":" ) + 2 );
        }
        result.Message = message;
    }
    return result;
}
#    Comments [0] |
# Saturday, 13 March 2010

Exploring Facebook API

I’m looking at creating a new website for our ATV club, but we also have a fan page on Facebook… looking to integrate the two… offering some basic info from Facebook onto our site seems easy… now looking to see if and how I can have a list of Facebook events on own site.

The box below shows a Fan Box for our club.

An here is a Page Badge:

Dwinal Pond 4 Seasons Club | Promote Your Page Too

Go to http://developer.facebook.com to create these widgets for your site.

#    Comments [0] |
# Wednesday, 10 March 2010

Reading Excel files in a WCF service using OleDB requires 32bit process

I’ve been doing a little work on a WCF service that reads an Excel file. My development machine is running Windows 7 64bit and my service was deployed to IIS. I kept running into a problem with opening the OleDb connection to the Excel file: “Error: Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.”

Turns out that Office Jet provider will only run in 32bit. After changing my ASP.NET processes to run in 32bit everything ran just fine.

This KB article shows how to change ASP.NET to 32bit: http://support.microsoft.com/kb/894435/en-us

#    Comments [2] |
# Tuesday, 09 March 2010

Translating Software Maintainability Metrics into dollars

Nowadays there are a variety of tools and services available that provide insight into the quality of the code. In order to quantify quality a number of metrics are collected and used to create a maintainability index number. Visual Studio Team System gathers metrics to put a number on the quality of your code. While Omnext offers code is a company which offers services around providing insight into the functioning, quality, and size of software. Now what to do once you have a number? What does it really mean, other than wanting to be good and not score low on a report?

I offer a basic solution:

A project which scores high on maintainability can be maintained by junior to medior skilled developers.
A project that scores low requires senior developers to maintain the application and effectively do what a junior could do on a better code base.

This leads to a simple mathematical deduction.

A senior developer costs 30% to 40% more than a junior. Therefore a bad system will cost 30% to 40% more to maintain than a good system. Of course the increase is not quite linear so if we put it on a sliding scale/table we get:

Maintainability Index

Increase in maintenance cost

0

n/a

10

n/a

20

60%

30

40%

40

30%

50

22.5%

60

15%

70

10%

80

5%

90

2.5%

100

0%

 

image

 

Feel free to refer to this as the Blomsma Code Metrics Cost Factor.
:-)

#    Comments [0] |
# Monday, 01 March 2010

SQL Azure Backup

Last week at the BAND user group meeting in Bangor me and Chris Bowen had a little unresolved discussion about how SQL Azure manages backups. Today I found (thanks to Ben Rees) a segment of a presentation that was done at PDC’09 by Dave Campbell and Tony Petrossian. I grabbed the screen that covers what is and what will be available when it comes to backup.

image

1. Automatic failover. Every SQL Server instance will be configured for automatic failover. This is part of the standard service, no additional charge.
2. BCP, SSIS or other custom tools. Today (3/1/2010) there is only one way to create backups and that is pull the data to a local backup. You end up paying for bandwidth usage.
3. Database clone. A on demand backup which creates an (almost) instant replica of your database. Useful before doing schema changes and you could easily schedule the creation of a daily clone if you wish to do so. You pay for the storage. This feature should become available 1H 2010.
4. Continuous Backup. Backups run as specified by user where you will be able to restore the database to a specific point in time. Pricing not available yet. This feature should become available 2H 2010.

Update: Original video is here.

#    Comments [0] |
# Thursday, 11 February 2010

Visual Studio & MSDN availability on Amazon

VS2010 is not yet available on Amazon.com, but VS2008 with MSDN subscription is. If you purchase VS2008 with a MSDN subscription today then you will still qualify for a free upgrade to VS2010 when it goes RTM.

image

More info on the offer here: http://www.microsoft.com/visualstudio/en-us/howtobuy/ultimate-offer.mspx

#    Comments [0] |

VS2010 & TFS2010 Licensing Whitepaper

Now that the Release Candidate is available and RTM is scheduled for April 12th it will be time to see how you can get licenses for these great tools.
Read the Licensing Whitepaper to find out what you need: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2b1504e6-0bf1-46da-be0e-85cc792c6b9d

#    Comments [0] |
# Tuesday, 09 February 2010

Using Windows 7 Search to delete ‘obj’ folders

Visual Studio will create ‘obj’ folders within your solution to store a bunch of temporary files. You can remove these files in a number of ways.
One easy way is to use Windows 7 Search to look for all the ‘obj’ folders and just delete them manually.
To do this I use the ‘kind’ keyword in the query box.

 image

Tip: Just typing ‘kind:’ will give you a list of choices to choose from.

For a complete overview of the Windows 7 Search syntax go to: http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx

#    Comments [0] |
# Monday, 08 February 2010

Visual Studio 2010 RC and Team Foundation Server 2010 RC available

Both Visual Studio 2010 RC as well a Team Foundation Server 2010 RC are available to MSDN Subscribers as of today.
Go to: http://msdn.microsoft.com/en-us/subscriptions/downloads/default.aspx

If you want to provide feedback on this release then you do so by using Microsoft Connect.
Go to: https://connect.microsoft.com/VisualStudio

For any additional information about versions of Visual Studio 2010 and .NET Framework 4,
Go to: Visual Studio 2010 and .NET Framework 4 Release Candidate

#    Comments [0] |
# Tuesday, 02 February 2010

MDN - Augusta Developer Event, 24th of February 2010

Time for the first Augusta Developer Event of 2010. Join us for a morning filled with information about Silverlight. Shawn, Chris and Mark will present a variety of topics and we've planned a group discussion, so make sure you come prepared with questions, examples and your experiences.

When
February 24th, 2010 at 9:00am.

What is Silverlight?
Shawn Robichaud – 15 min
Introduction to Silverlight for decision makers, architects and developers.

Choosing the right technology
Mark Blomsma - 30 min
Silverlight vs. WFP vs. Windows Forms vs. ASP.NET. A session for decision makers, architects and developers. Which technology to use for which scenario?

Choosing the right technology – group discussion
Everyone - 30 min
Silverlight vs. WFP vs. Windows Forms vs. ASP.NET. A session for decision makers, architects and developers. Which technology would YOU use for which scenario? Please come prepared with questions, examples and ready to share your experiences.

Silverlight and Section 508 compliance
Mark Blomsma – 30 min
“Section 508 requires that all Web site content be equally accessible to people with disabilities. This applies to Web applications, Web pages and all attached files. It applies to intranet as well as public-facing Web pages.” (http://usability.gov).

Silverlight architecture overview
Chris Bowen – 30 min
Introduction to XAML, Silverlight assemblies, n-tier development, asynchronous behavior, …

Silverlight + Windows Communication Foundation overview
Chris Bowen - 30 min
Introduction to WCF based on a Silverlight demo.

Silverlight + RIA Service overview
Chris Bowen - 30 min
Introduction to RIA Services based on a Silverlight demo.

Wrap up
15 minutes.

 

Location
The event will be held at:
State of Maine Offices
Harlow Building
First floor conference room
18 Elkins Ave
Augusta

RSVP
Please register so we can make sure we have sufficient room.
Register here: http://www.maine-devnet.org/Home/SignUpForEvent.aspx.

#    Comments [0] |
# Tuesday, 12 January 2010

Kindle DX

Amazon is finally offering a Kindle which will also download books when you’re overseas. Not sure if they’re hitting the sweet spot when it comes to pricing. I think I’ll wait for the various slates (slim tablet PC’s) that are becoming available this year.

My suggestion for Apple and HP: put a WhisperNet Mobile card in your slate that will allow free access to just your AppStore!

#    Comments [0] |
# Friday, 01 January 2010

MVP 2010

Whoah! Just received an email from PJ:

“We are pleased to present you with the 2010 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C# technical communities during the past year.”

I’ve once again been honored with the Microsoft Most Valuable Professional Award. This is the seventh year running that I’ve been lucky enough to receive this great award and I it’s great to be part of the group of people that receive this award.

#    Comments [1] |
# Wednesday, 23 December 2009

String.Humanize()

Another extension method… I just ran into the need to humanize some strings into more friendly ones. This can be used to humanize the name of an enumeration. It will turn a “CamelCasedString” into a “Camel Cased String”.

public static class StringExtension
{
  
/// <summary>
   /// Humanize a "CamelCasedString" into "Camel Cased String".
   /// </summary>
   /// <param name="source"></param>
   /// <returns></returns>
   public static string Humanize(this string source )
    {
      
StringBuilder sb =new StringBuilder();

      
char last =char.MinValue;
      
foreach (char cin source )
        {
          
if (char.IsLower( last ) ==true &&char.IsUpper( c ) ==true )
            {
                sb.Append(
' ' );
            }
            sb.Append( c );
            last = c;
        }
      
return sb.ToString();
    }
}

#    Comments [0] |
# Friday, 18 December 2009

Visual Studio 2010 and .NET Framework 4 Beta period extended

Soma just announced that the beta period for VS2010 and .NET 4.0 has been extended and the release date is being pushed back a couple of weeks (no new date mentioned yet).

Also, in addition to the 2 beta’s that have been released there will be an additional public Release Candidate that everyone gets to play with :-)

 

Read more: http://blogs.msdn.com/somasegar/archive/2009/12/17/visual-studio-2010-and-net-framework-4-beta-period-extended.aspx

#    Comments [0] |
# Wednesday, 02 December 2009

Just took a walk around Fenway – using Bing Maps

Bing Maps just released a new (beta) way of exploring maps. It allows you to walk and look around ‘inside’ the map. With Sophie sitting next to me on the couch we took a walk around Fenway Park.

Use this link to jump to the ticket office: http://www.bing.com/maps/explore/default.aspx#5872/lat=42.34667&lon=-71.098862&alt=-48.11&z=30&h=137.8&p=2.9&pid=5082/5003/0.6002=q:Fenway+Park,+Boston,+MA+USA:lat:42.3586715525037:long:-71.0566996783018

#    Comments [3] |

DDE Client –> NDde on CodePlex

I’ve been doing some research into writing a DDE client in C#. Turns out there is project on CodePlex called NDde (http://www.codeplex.com/ndde) which offers a good starting point. For some reason it took many Bing’s and Google’s before stumbling onto this little gem.

#    Comments [0] |
# Tuesday, 01 December 2009

Have to learn Japanese

Today I wanted to provide some feedback on a cool product (Live Mesh) I’ve been beta testing. I clicked the feedback link and saw this:

 

image

 

I guess I’ll have to learn Japanese :-)

 

Update: Feedback for Live Mesh can go here: https://connect.microsoft.com/LiveMesh

Update: Vote for my suggestion: https://connect.microsoft.com/LiveMesh/feedback/ViewFeedback.aspx?FeedbackID=516914
My suggestion is:

I'd like to be able to temporarily take a folder offline. I imagine being able to right click on a Mesh Folder and choose from being offline for X amount of minutes or X hours.

Scenario:
As a developer I share my sources folder across multiple machines. Every recompile in Visual Studio leads to files getting synced. I don't need them to be synced until I'm done for the day/morning/afternoon.

I imagine this feature appeals to anyone who shares a folder with high frequent changes.

#    Comments [0] |
# Wednesday, 11 November 2009

Sign up now for Software Development Event (December 2009)

The schedule for the December Software Development Event is set (see below). There is another great line up of speaker and it looks to be a great event. Sign up at: http://www.sdn.nl/SDN/SDNEvent/SDNEventdecember2009/tabid/132/Default.aspx.

The event will be held at;
Van der Valk Hotel Houten
Hoofdveste 25
3992 DH Houten

 

Schedule

image

#    Comments [0] |