Sunday, November 07, 2010

VisualStudio 2010 close window performance

Finally I've got to the bottom of one of the Visual Studio 2010 performance problems.

Using Mark Russinovich's Sysinternals ProcessMonitor I cleared by environment down as best as possible and did some evaluation of what devenv.exe was accessing.

For some reason it's accessing the .proj files on a very frequent basis but it doesn't appear to be this causing the performance issue.

Using the File Summary option under tools though indicated that whilst closing a single editor tab there was just over 1 second being spent writing to the suo file - that seems very excessive.

Looking at the .suo file for the solution it was 1.2MB in size - hardly excessive but I guess it all depends on what it contains. I renamed the file and repeated the close of the editor window... almost no lag... a solution? Well possibly.

So what does the suo file contain? It's an OLE compound document and appears to contain a whole bunch of information persisted by the VS and any add-ins.

Have now been assigned a Microsoft Connect bug id of 619775 so will see if they accept and fix it.

Sunday, October 31, 2010

SQL Server Reading

It's been a while since I sat down a read a decent book in the SQL server space - I'm fairly sceptical about the new additions to most database products recently - they've not really been addressing core functionality - just adding minority requirements that don't really gain much.

Considering the above I wasn't expecting much from a single read so bought a collection of books and though that across them I might find a few useful bits and pieces - I was pleasantly surprised by all three books - each had something unique to say and each approached the subject in quite distinct ways.

Links to the books below:





Saturday, October 30, 2010

VisualStudio 2010 performance

Editor performance in VisualStudio on my machine is best described as dreadful - it's very rare to be working on an editor where you actually have to look up to see where the cursor has actually got to especially when touch typing - and yet in VS2010 you have to because it reacts so poorly.

There's a semblance of a fix which has worked for me by turning off the hardware acceleration (due to VS2010 being a WPF app). Tools -> Options -> General -> in the middle are a bunch of options for experience - turn them all off and see if you find that it speeds up.

Friday, October 29, 2010

Compro VideoMate S350 on SuSE 11.2

Well according to the forums people have varied luck with the S350 - I guess there must be multiple models out there as I finally got mind working although it was a bit of a challenge.

The card has the following chipset

saa7164 - this is detected as an unknown card
saa7130/34 - this is detected by v4l2 and driver version 0.2.16 is loaded
saa7133 - this is detected correctly as a Compro VideoMate S350/S300 (card 169)

After dbb_init() the adapter is registered
saa7133[0]
Zarlink ZL10313 DVB-S

This gives you a single channel DVB-S adapter to play with

Saturday, October 16, 2010

Hauppauge Nova-PCI

Hauppauge Nova-PCT DTV tuner

Requires the following settings in /etc/modprobe or /etc/modprobe.d

options dvb_usb_dib0700 force_lna_activation=1
options dvb_usb disable_rc_polling=1

Thursday, July 29, 2010

MVC 2 Notes

Some brief notes about gotcha's and good practices for ASP.Net MVC 2

  • Always use Html.AntiForgeryToken() and use the [ValidateAntiForgeryToken] attribute to ensure that it has been checked on each action

  • Add ActionFilters to handle errors against each controller for the standard error types such as that thrown from ValidateAntiForgeryToken

  • Model binders will bind anything at any time so ensure that binding policies are in place so that users can maliciously bind data

  • Use Linq-to-SQL timestamp logic to protected against concurrency patterns along with the pattern whereby a "stub" object is created with just the PK and the TS value. Then use the Attach method in Linq to do the actual update. Again trap the error and provide good options for the user to continue

  • Use T4MVC to pre-parse all magic-strings into constants and use them throughout

  • Use localised templates copied from "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\VisualBasic\Web\MVC 2\CodeTemplates" / "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 2\CodeTemplates" to get consistent and useful templates rather than the Microsoft default ones

  • Tick the box to allow edit-and-continue in web applications

  • Tick the box to ensure that the the views are compiled to make sure any errors are caught

  • Be sure to use HttpPost actions when performing any CRUD type actions to prevent spiders from accidentally performing actions

  • Use NUnit / Microsoft Test to perform unit testing of controllers and models

  • Use Moq / Rhino Mocks for mocking of objects for testing

  • Use Castle Windsor / NInject for inversion of control / dependency injection

  • Use areas to divide up large applications

  • Use post followed by a RedirectAction if successful to prevent the "repeated post" warning from the browser

  • To prevent ASP.Net from filtering some URLs use the following config parameter <httpRuntime relaxedUrlToFileSystemMapping="true"/>

  • Use DisplayTemplates to enable rendering of custom datatypes as well as the built-in ones

  • Keep an eye on the ASP.Net MVC Futures stuff on codeplex as it often contains code that will be included in the next major revisions of ASP.Net MVC

Tuesday, June 22, 2010

Exchange 2010 Public Folders

Whilst migrating from Exchange 2003 to Exchange 2010 I came across a very frustrating issue whereby the Exchange 2010 public folder tree just wouldn't replicate across from the Exchange 2003 source.

I could create new public folders in Ex2010 and see them replicate across to Ex2003 but I just couldn't find what was wrong. I could see lots of replication messages in the queue from Ex2003 but they simply weren't being accepted in Ex2010. Strangely though when I had debugging turned on I didn't feel like I could see enough messages at the Ex2010 end.

About 6 hours into the investigation I finally stumbled across the issue - Ex2003 was set to use a smarthost on the SMTP connector and it was stupidly forwarding all of the internal replication traffic via that smarthost, which in-turn was of course losing any security credentials required to actually do the replication.

Remove the smart host on the Ex2003 box (and restart the SMTP service) and all of a sudden the folder tree was in place on Ex2010.