November 2005 - Posts
Because I know I won't be able to find these in the future unless I blog them here!
With so many new technology previews coming out of Microsoft recently it is hard to find to time to investigate and try out these tools.
Microsoft has some
great hosted labs, you can try for free, think Terminal Server/Remote Desktop into a pre-configured lab session complete with a labs manual for you to work through some basic concepts.
There is a
Windows Workflow Foundation lab:
"Windows Workflow Foundation is the programming model, engine and tools for quickly building workflow enabled applications on Windows. It consists of a WinFX? namespace, an in-process workflow engine, and designers for Visual Studio 2005.
Learn how to create simple workflows and use them in Windows applications via MSDN’s Windows Workflow Foundation virtual lab. This free, 90-minute, guided hands on lab will teach you how to:
- Create and debug a hello world workflow.
- Receive data into the workflow using parameters.
- Create an expense reporting workflow using IF/Else?, declarative conditions and custom activities.
- Extend the expense workflow with some advanced event-based activities."
Most developers/architects are used to the
four tenets of Service-Orientated design now. There is a great writeup on MSDN in the "
Principles of Service Design: Service Patterns and Anti-Patterns" paper on designing services and helping you stay away from anti-patterns like CRUDy & loosey goosey interfaces to better document and messaging patterns.
Well reading the first Windows Workflow Foundation book it's speaks about four tenets of workflow.
- Tenet 1: Workflows coordinate work performed by people and software.
- Tenet 2: Workflows are long running and stateful.
- Tenet 3: Workflows are based on extensible models.
- Tenet 4: Workflows are transparent and dynamic through their lifecycle.
John Evdemon goes into
each of these with a full explanation.
Whilst on the subject of WWF, Brian Loesgen has a great table
comparing Biztalk and WWF, the basic point being think
Biztalk as workflow across applications and WWF within applications.
Can Google do no wrong?
Rob Howard notes that if Microsoft was moving in the same way Google is currently they would raise alarm bells. Well I'm not getting into all the
Hailstorm/Google conspiracy, but the
list of Google services is getting longer, we'll just have to watch how
http://www.live.com/ &
http://www.start.com/ develop next year.
A few photos of
Google's new office in London over near Victoria, can they replicate the fun workplace here in the UK?
Guessing most people who have installed and played with the Visual Studio Community Technology Previews (CTP) will have already been through the pain of uninstalling and getting the release to manufacture (RTM) bits of Visual Studio 2005 installed.
But in case not, I thought I'd share some of the steps I needed to perform. You really need to uninstall all the beta bits, including WinFX
? bits you might have tried out over the last year or so.
Aaron Stebner has a good writeup on the
offical uninstall instructions and some of the automated tools.
But using these tools didn't completely remove everything for me. Brad Adrams also suffered 'dirty' laptop problems with the pre-release builds and talks through using
MSIZip and MSIInv.
MSIZap is a Windows Installer cleanup utility, available from
support.microsoft.com which can more remove files and registry settings that the standard Add/Remove programs might not get.
I shelled out to the commandline and piped the contents from MSIInv to a text file, msiinv > log.txt. Then used Notepad to find the GUIDs for the pieces of Visual Studio CTP and SQL Server CTP still left. Finally running MSIZap, msizap {package code guid} to remove those pieces.
Whilst on the subject of Visual Studio 2005, could they not have thought at bit more on the splash screen and how the list of installed add-ins/products would look with long descriptions and multiple items. I've still got to use RegMon from SysInternals to figure how why it shows multiple for the SQL Server tools!

It can be difficult to get a good balance between straight knowledge and more probing design questions when interviewing people, especially first round over the phone.
Not to be followed word for word but Scott Hanselman's list is a great start, covering general information and then more drill-down on what senior developers should be able discuss.
Mix those in with some good open discussions and hopefully you'll be able to spot a great candidate.
A little bit old now, but these emails, from Bill Gates and Ray Ozzie, offer an interesting look at management communications inside Microsoft.
The memo offers a reflective look at what Microsoft thinks the competitive landscape is like and how users are expecting 'seamless' computing at home and work these days.
As an aside, what are the timescales around people reviewing and excepting the RSS extensions proposed, like
lists and
sharing (SSE)?
I had a couple of email messages forwarded to me which contained Powerpoint presentations, unfortunately
Hotmail stripped these into separate text attachment messages.
This meant the original message and it's attachments were in the same file, with the .ppt encoded as base64 block.
So a little
search later I found this handy pop3 mail tool,
getmail.
It was then a matter of running,
getmail -forceextract msg.txt
to separate the presentation out.
Microsoft UK recorded the sessions from one of the main rooms at the recent DeveloperDeveloperDeveloper Day community event.
Because the event is for the community and by the community, we don't have huge web hosting and media streaming facilities. So faced with 6 video clips each 550Mb in size, what was the best way to quickly and easily host these for people to download?
Well I decided to experiment using BitTorrent, a peer-to-peer file sharing system. As explained here, What is BitTorrent?, it's a scalable distribution solution where users co-operate and share what they have downloaded with other people who are also downloading or seeding at the same time.
Although peer-to-peer file sharing often gets bad press being associated with illegal use, it is a fanastic way to utilise available bandwidth amongst multiple users who would otherwise saturate the one source of the content. The moment one person has some of the file, they immediately start sharing it with everyone.
To create a .torrent file, you could use either TorrentSpy or Azureus, these tools create a small text file which contents basic information of the original file, hashes of 'chunks' of the file and the tracker location.
The tracker tells clients about the other clients who then communicate directly with each other. So we used a free, legal tracker called Bittorrent Support (unfortunately this site doesn't seem to be available anymore), another which seems popular is Mongo56. BitTorrent uses a range of ports, normally 6881-6889, so a quick router configuration was needed to port-forward these to my desktop PC.
In only 4 days I seeding and transferred over 25Gb of traffic from these 6 video clips to a large number of people, who would have saturated the website hosting if we had hosted all 3Gb of data! That's not counting the other traffic the peers were sharing amongst each other.
However because installing a BitTorrent client isn't as easy as downloading a .wmv file via http, I also looked into re-encoding these large clips into a more compressed format using Windows Media Encoder. I could bring the bit-rate down with no noticeable loss in quality (the screen capture wasn't perfect and already had compression artifacts), meaning the recompressed file sizes were about 100Mb each - but the encoding took about 6 hours to process on each file. So over the week these were generated and then hosted on the site as normal, 600Mb is alot smaller than 3Gb!
Overall I was pleased with the experiment and it kind of had a community feel about sharing the files like that. We'll look at other mechanisms for the future (using Google Video just didn't seem right ;) ) and also other compression settings.
Peer-to-peer technology is here to stay and will become more widespread in legal distribution; you might be using FolderShare to synchronize your own content or a spin-off from Microsoft Research SplitStream for your WindowsUpdate or MSDN subscribers content in the near future.
(We would like to point out that the content we were distributing was free and non-copyright, in no way do we condone illegal distribution of copyright material)
Can you have memory leaks in managed code? Yes!
Most developers think for a little while, mention the garbage collector and pinvoke, RCW calls to unmanaged code. But when pushed on a purely managed code situation the answers tend to be less sure.
If you think of memory leaks as an application not properly releasing objects when they are no longer needed then just keeping a reference to a no longer used object is a good example, and the garbage collector won't help here. There are other ways, such as blocking the finalizer thread for example. Dan Crevier talks about an automated way to detect leaks and how they used used the technqiue when developing Microsoft Max.
Rico Mariani has a more details post on tracking down managed memory leaks, showing you how to use Windbg, CLR Profiler and the SOS (Son of Strike) debugger extension. The SOS extension isn't for everyday debugging, fortunately Mike Taulty of Microsoft UK has a great video nugget showing how it works.
Don't forget either the Improving .NET application performance and scalability patterns and practices book I've mentioned before as an essential read.
Another MSDN article on production debugging of .NET framework applications explains how to determine if you have a leak in managed or unmanaged code:
Native Memory Consumption
If the Private Bytes counter in Perfmon increases while the .NET # of Bytes in all Heaps counter stays flat, this is evidence of native memory consumption.
Managed Memory Consumption
When using Perfmon, if both the Private Bytes counter and the .NET # of Bytes in all Heaps counter increase at the same rate, this is evidence of managed memory consumption. Look at the size of allocated managed memory and consider what the GC is doing. When looking at the dump file, use SOS commands to list the managed heap size and compare it to the total size of the dump file. Consider what details you can learn about the large object heap and the generations. Look to see if large objects (85 KB or more) or smaller objects consume most of the memory. If it's the former, look at the details of the large object heap. If it's the latter, consider what generations 0, 1, and 2 contain. For large objects, determine if they are rooted, and whether or not they should be rooted. If they aren't rooted, they are candidates for collections. Determine if they are eventually collected properly.
Whilst on the subject of debugging, I hadn't noticed this little tip of pressing Ctrl whilst viewing a DataTip in Visual Studio 2005 (or press the middle mouse wheel) to make it transparent so you can see the code underneath.