
|
Home
You've reached the Internet home of Kenny Kerr. I specialize in component-based development of desktop and distributed applications for the Microsoft Windows platform. This includes development using C++, C#, .NET, COM, ATL and Win32.
Saturday, 15 May 2004After blogging here for almost three years, I have finally found a new home for my blog. This will remain my personal website and I will eventually restructure it accordingly. You can find my new blog here: http://weblogs.asp.net/kennykerr/ And you can subscribe here: http://weblogs.asp.net/kennykerr/Rss.aspx
Wednesday, 17 March 2004My new security article is headlined on the MSDN Security Developer Center.
I am in the process of writing a number of articles for MSDN covering security and Visual C++. They should be out in the next few weeks and months. Here is a list of some previous articles that I've written.
Friday, 23 January 2004I posted some pictures from our trip to South Africa.
Monday, 19 January 2004Sorry for the long absence, again. I spent most of December in South Africa visiting friends and family and generally resting after a long year spending too much time working and not enough time with my family. Anyway, I’m back! One of the Windows services of a large project I was working on last year had the option of writing verbose logging to a local log file. This log file would routinely be synchronized back to the server where it could be analyzed more easily. But it was often useful to monitor the log file locally. One of the developers on my team heads up the UNIX development. He naturally typed tail –f at the command line and sat back to watch as the service appended log entries to the end of the file. Not to be outdone, I decided to write a quick tail command for Windows. I wasn’t really concerned about all the features of the UNIX tail command. I just wanted to have the same functionality on Windows, and after a few minutes I was done! Here it is. My very own Tail utility. (Requires .NET 1.1) So here's how it works. I first make sure I have the absolute path to the file, provided by the user, using the Path.GetFullPath method. I then open the file for read access. The important thing here is that the file is opened with sharing mode to allow other processes to open the file for reading and/or writing using FileShare.ReadWrite. This is equivalent to using FILE_SHARE_READ | FILE_SHARE_WRITE with the CreateFile function. If the file is quite long, I only print out the last 1000 bytes (to give you some context). I then place a file system watcher on the file to watch for file size changed events. The rest is self-explanatory. Really simple, but really effective. Enjoy! using System;
using System.IO; class EntryPoint {  static void Main(string[] args)  { Console.WriteLine("Kenny Kerr's Tail Utility 1.0"); Console.WriteLine();        if (1 != args.Length || !File.Exists(args[0]))    { Console.WriteLine("Usage: tail <filename>");    }    else    {      string fileName = Path.GetFullPath(args[0]);      using (FileStream stream = new FileStream(fileName,                           FileMode.Open,                           FileAccess.Read,                           FileShare.ReadWrite))      {        stream.Position = (1000 <= stream.Length ? stream.Length - 1000 : 0);                m_reader = new StreamReader(stream, true); FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(fileName),                                 Path.GetFileName(fileName));        watcher.NotifyFilter = NotifyFilters.Size;        watcher.Changed += new FileSystemEventHandler(ReadFromFile);        watcher.EnableRaisingEvents = true; ReadToEnd(); Console.ReadLine();      }    }  }  static void ReadFromFile(object sender,               FileSystemEventArgs args)  { ReadToEnd();  }  static void ReadToEnd()  {    lock (m_reader)    { Console.Write(m_reader.ReadToEnd());    }  }  static StreamReader m_reader; }
Thursday, 20 November 2003I've just finished reading Inside Microsoft SQL Server. This book is packed with lots of detailed information to help you build better applications with SQL Server. I highly recommend it. I also update my Websites page after what feels like a decade.
Monday, 10 November 2003Quick! What time is this: "2003-11-11T02:18:57.5830000-05:00" ? Why, its 9:18 PM today in Eastern Standard Time, couldn't you tell! This is an example of the XML Schema dateTime data type. If you spend a lot of time building distributed applications using Web Services and XML Schema you've probably come across this quite a lot. While developing some software recently I got tired of always having to figure out whether the date was actually correct so I wrote a tiny little utility to help me out. My Date Disassembler (DateDasm) localizes the date and time and displays it in a user-friendly format. Its a very simple little tool but its the little things that make your life easier. For example DateDasm automatically checks the clipboard for a valid dateTime string when it starts so all you have to do is copy the date string and launch the utility. Enjoy!
(Requires the .NET Framework 1.1)
Saturday, 8 November 2003I first heard about the Semantic Web when I interviewed at a small startup company in Toronto, ostensibly at the forefront of building the Semantic Web. The message I got from this startup of the value that the Semantic Web provides never really made much sense to me. Even after reading Tim Berners-Lee's article on the topic I just couldn't picture how it would ever work. I'm all for meta-data and self-describing software and data. I regularly use things like database schemas, WSDL and reflection. But unless everyone in the world will agree on how to describe things, meta-data will almost always be context-sensitive and contain meaning that is specific to a certain source. The obvious exception is for simple things. Things like RSS and HTTP. Not to say these things are necessarily simple in their implementation, but they impose very few rules that you need to follow in order to play along. It reminds me of the COM vs. CORBA debate where CORBA enthusiasts claimed that COM was not truly object technology because it didn't meet some mystical acid test for object purity. Arguably COM succeeded where CORBA failed because Microsoft took a more pragmatic (commercially viable) approach. COM was a huge success even if it didn't meet certain mystical standards. In the same way many people believed the world's interoperability woes would be solved by XML and XML Schemas - we would just come up with a set of common schemas that everyone would agree on and that would be that. Well nobody can agree on anything so that never worked. Instead Microsoft comes up with tools like BizTalk that take a more realistic view of interoperability. Anyway, my point really is just that the Semantic Web doesn't look like it has much chance of success in the commercial world. Clay Shirky does a much better job of explaining it than I do. I may be wrong. This is just a blog, so I can change my mind tomorrow. :)
Monday, 4 November 2003I've updated my Bookshelf. Check it out!
Saturday, 1 November 2003I wanted to talk about why it is a bad idea to throw exceptions from implementations of System.IDisposable.Dispose. Its similar to C++ destructors so lets quickly talk about that. Half the people I've spoken to recently think its fine to throw an exception from a destructor. They're wrong. The other half know that its a bad idea but don't seem to know why. There is a common misconception that throwing an exception from a destructor is bad because any destructors that follow will not get called. This is wrong. C++ guarantees that if a type's constructor is called successfully that the destructor will also be called. So this is not an issue. The real reason why it is bad is that the destructor may be called while the stack is being unwound as a result of another exception. When this happens the program will terminate. And since the destructor has no way of knowing whether its being called under normal conditions or as a result of an exception, it should just abstain from throwing exceptions. (Strictly speaking there is a language feature in C++ that allows you to determine whether an exception is currently in progress. I would advise against using it though, since it would make it harder for developers to know how your class will behave in all cases.) Now on to what I really wanted to talk about. Don't throw exceptions from implementations of IDisposable.Dispose. The IDisposable interface is typically used with the C# using statement to simulate deterministic finalization. The effect of this is that the Dispose method could be called under normal conditions or as a result of an exception. So if you throw an exception from the Dispose method it may occur while another exception is currently unwinding the stack. What happens next is different to the C++ runtime, but its just as bad. When the second exception is thrown, the original exception is lost entirely as the new exception is thrown. Your program won't necessarily terminate, as it does in C++, but it will make it extremely hard for developers using your class to figure out what on earth went wrong since the original cause of the error is lost. This is really just a special case of throwing an exception from a finally block. So don't do it! :)
Friday, 31 October 2003
Chris Anderson gave a great talk on the new application programming model for Longhorn. Its hot. I also attended an interesting talk by Jan Gray, the CLR performance architect. I briefly met him at the Attendees Party at Universal Studios - very nice guy. For more information check out PDC Central.
Friday, 17 October 2003OK, so its been a really really long time since I posted anything here. This year has been very busy for me. We're doing some really cool stuff at PlateSpin, building a power distributed platform for abstracting and automating data center resources. Being the chief designer and lead developer has kept me incredibly busy. But I really want to get back to other things that I love doing, like writing about technology and teaching. So I promise to start posting more frequently to this blog. I also have some security related articles coming out in the next few months. So stay tuned! If you've tried to get hold of me through my hotmail address, I apologize for not responding. I've been so bombarded with junk mail that I've given up trying to dig through it. So if you're not on my "safe list", you can get in touch with me by calling the PlateSpin office.
Tuesday, 27 May 2003I came across some other useful tools on the web. Last year I won the (rather nerdy) Windows Forms Coding Hero award for my Icon Browser tool. The first coding hero was Lutz Roeder. He recently updated his most excellent Reflector for .NET, which now includes a decompiler so that you can view the MSIL in C#! Karin recently redesigned her site with a really nice new look. Check it out! She also told me about the Bible Gateway, an incredible resource for searching just about every translation of the Bible. Unfortunately it doesn't provide a web services interface, but the site documents its form-based query format so that you can tie that into your own applications or sites.
Monday, 26 May 2003I've been using a number of new applications lately. Microsoft Office 2003 is a really significant upgrade. Among the many usability improvements, Outlook is the most significant. This is the first version of Outlook that does a good job of integrating Hotmail. The new Outlook user experience is also incredible. A new product that we have played with is the Windows SharePoint Services Beta. At first we all loved it. It is a million miles better than the tool that most of my colleagues had been using. But then I took a look under the hood. The database schema is horribly denormalized (the same data stored in different places) and SharePoint stores a lot of installation specific information (such as the machine name) straight in the database. Normally this would only be a concern to the SharePoint developers who would be challenged with writing the upgrade scripts. But in this case we tried to do a backup of our SharePoint installation, using the supplied backup tool, and then a restore. My very smart friend spent the better part of a day trying to restore it without any luck. Hopefully the SharePoint team fixes this before the release. I would really like to give this kick-ass product another try. I also now using Windows Server 2003 on my development machine. I love it! It's so nice having an MSDN subscription. :)
Tuesday, 6 May 2003I needed a way to back up a file in such a way that I could restore it perfectly. This seems simple at first, but when you consider cool features like NTFS data streams and important things like security descriptors, you realize that there is quite a lot more to it. Then I came across the BackupRead and BackupWrite functions that take care of all the details. They aren't very easy to use however, so I wrote a helpful little wrapper class in C#. You can download it here. Take a look at this example to see how easy it is to backup and restore files with the help of my BackupFile class. Disclaimer: I've only tested this on Windows 2003. Older platforms had some bugs in the API functions, but they should be fixed in the latest service packs. using System;
using System.IO; using Kerr.Samples; class EntryPoint {  static void Main()  { MemoryStream stream = new MemoryStream();    using (BackupFile file = new BackupFile(@"C:\Data\foo.txt",                        true)) // open for backup    {      file.Backup(stream);    }    stream.Seek(0, SeekOrigin.Begin);    using (BackupFile file = new BackupFile(@"C:\Data\foo2.txt",                        false)) // create for restore    {      file.Restore(stream);    }  } }
Wednesday, 16 April 2003After years of staunch resistance, I have finally conceded and admit that there is no place for Hungarian notation in object oriented programming, including C++. Of course it is still very useful when programming in C. Stroustrup says it best. class Person
{  public Person(string name) // strName  {    m_name = name;  }  ...  private string m_name; // m_strName } The csharpindex.com/colorCode website is gone, but I found another site that does the same thing.
Sunday, 13 April 2003My son Joshua finally fits into his Microsoft t-shirt that I got for him back in February 2002.I forgot to mention a book yesterday. I have been using the Standard C++ Library, more commonly known as STL, for a number of years now. I was very happy to find that Scott Meyers had finally written a book dedicated to it. If you enjoyed his previous books, you will love reading Effective STL. I'm thinking of rebuilding my website using ASP.NET. The primary motivator for doing this is so that I can automate a lot of my web logging activities. I will naturally support RSS. Stay tuned.
Saturday, 12 April 2003
This is Mia, my little princess. For more pictures, visit Karin's site. I've read a lot of great books lately. The Pragmatic Programmer is a really enjoyable read. Much of it is just common sense, but its still a great collection of tips and advice to help you be more productive. I recommend this book, even if the authors are a bit biased toward UNIX and Java. :) Inside Windows 2000 is a really in-depth look at the Windows NT architecture from the guys behind sysinternals. While you're there, check out their great tools like my personal favorite, Process Explorer. Although I'm not actively involved in developing device drivers, I wanted to learn more about the details of writing code in Kernel mode. Programming the Microsoft Windows Driver Model helped me a lot to understand what's involved. Jeffrey Richter's .NET book has to be the best book to read if you want to get a solid introduction to .NET Framework and the CLR. Once you've spent a lot of time getting to know the programming environment, you need to turn to Don Box's Essential .NET to get a better understanding of the inner workings of the CLR. As is to be expected from Don, this is a really enjoyable read and sure to teach you something. Ed and Carol are finally on the same page!
Thursday, 13 March 2003Marc Young just sent me a copy of his new book, Inside Microsoft Visual Studio .NET. If you're like me and live your life inside Visual Studio then this book is a must. This book is all about using Visual Studio. It covers everything from the basics of using the IDE to write code and build projects to advanced topics like extending Visual Studio with macros, add-ins and wizards. Marc makes use of my icon resource management classes for the add-in sample described in chapter 6.
Sunday, 16 February 2003The .NET Framework has a great pattern for assembly installation. Instead of requiring the assembly developer to communicate the installation needs to the developer of the setup program, he can simply write an Installer class to take care of it. Writing an Installer class is easy. Add a class to your assembly that derives from the Installer class, override the Install and Uninstall methods, and add the RunInstaller attribute. Here's an example:
Assuming the assembly's file name is Library.dll, its a simple matter of using the Installer Tool (installutil.exe) that comes with the .NET Framework SDK to invoke the installer class. All of this you probably already know. But requiring your clients to use a command line tool to install your software won't go down very well. For that you need a professional setup program. You could use InstallShield, but the latest version of InstallShield still doesn't fully support installer classes. The alternative is to use the AssemblyInstaller class to call your installer class programmatically from your own setup program:
This sounds great until you try and write the uninstall code:
What's wrong with that? The call to File.Delete throws an UnauthorizedAccessException exception with the message "Access to the path "Library.dll" is denied.". To understand what's going on here you need to understand a bit about how the CLR works with assemblies and Application Domains (AppDomains). AppDomains provide the same isolation from other CLR applications as processes do for the operating system and native applications. All types that your code uses, and as a result all the assemblies that are loaded, are bound to that AppDomain for the life of the AppDomain. So whether you load an assembly explicitly using Assembly.Load and friends, or whether you reference an assembly and simply load one of its types, that assembly is now loaded into your AppDomain until the AppDomain closes. There is no way to unload an assembly once it has been loaded into an AppDomain. If you understand this, you should be able to see the problem with the code sample above. The AssemblyInstaller class needs to load the Library.dll assembly in order to reflect over its types and create the Installer class. But in doing so the Library.dll assembly is loaded into the AppDomain. As the assembly is loaded, the underlying file is also locked. To understand this you need to know a bit more about the native operating system loader (LoadLibrary) but I'll leave that for another day. The point is that you can't delete Library.dll until the assembly is unloaded. But you can't unload it because that would mean stopping your setup program. The trick is to create a secondary AppDomain that uses the AssemblyInstaller class on your behalf. When it completes, you simply unload the AppDomain, which will happily release the assembly. At this point you can freely delete Library.dll without a problem. Here's a simple example:
I never thought writing a setup program could be so interesting. :)
Friday, 31 January 2003Wouldn't it be nice to be able to write code without worrying about all that error handling? For a server application I'm working on I need to log all errors to an event log and then return a predefined error code to the caller. This way I can persist all the error information for an administrator to view at a later stage, and I don't accidentally let the caller see any privileged information that might be stored in the exception object. So I might have a method similar to this:
As you can see, the error handling code adds a lot of overhead. This gets really tedious if your server application's interface has a lot of methods and each of them need to be guarded in this way. C programmers have traditionally gotten around this by using macros. Being a C++ programmer, I tend to hate macros. Working a lot in C#, I can't even use macros even if I wanted to. Wouldn't it be nice if I could just add some magical attribute to take care of it? Something like an ErrorLogging attribute that can be applied to a class and all methods will automatically have their exceptions caught and processed.
As you can see, all the error handling code is gone. Unfortunately there is no such attribute. Fortunately you can write your own quite easily. The CLR has a rather elaborate interception framework that allows you to treat method calls as message exchanges. You can inject a message sink simply by writing a few classes to affect the context your object is running in. I won't bore you with the details. But if you're interested you can check out my sample code. And if you really want to understand what's going on here you'd better read Don Box's excellent book on the CLR. Before you get too excited however, these techniques are completely undocumented and unsupported by Microsoft. Furthermore they are almost guaranteed to change in the near future, which will make this code break. Microsoft doesn't want you to rely on the interception plumbing, even though much of their code relies on it. Hopefully the CLR team will nail the details down soon and make it public so the rest of us can finally make use of this. Our baby girl, Maria (Mia) Grace Kerr, was born on Saturday 18 January 2003. When she grows up she's going to be a princess. Isn't she adorable!
Tuesday, 5 November 2002Well its been a long time since I've updated my weblog. I've been taking a break from my website, mostly due to work pressure. I may give it a rebirth in the next few months with a completely different look and feel. In the mean time enjoy a laugh by reading Don Box's comments on .NET and Java: "Today's Favorite .NET Feature: Lack of EJB-style entity beans". Hahaha! I couldn't agree more.
Thursday, 14 September 2002I've just started using an automated build tool called FinalBuilder and I highly recommend it. I have traditionally rolled my own build process. This tool is saving us lots of time and effort, allowing us to focus on developing software, and not have to worry about the build process. I'm always looking for tools that will allow me to focus on developing software and not have to worry about the auxiliary things, like source control, managing automated builds, etc. If a tool takes too much time to maintain, its not worth it for me. For example, I use Visual SourceSafe. It doesn't have all the features of some of the more "advanced" source control systems, but its much easier to manage and virtually maintenance free, so I never have to worry about it. Keith Brown has written a cool little tool for managing passwords called Password Minder.
Tuesday, 20 August 2002I've received quite a lot of mail of late regarding my Kerr.Windows assembly and its useful security classes. Many of the questions surround the topic of Active Directory support. The Active Directory Distinguished Name format (inherited from LDAP) is used by the directory service to uniquely identify users (among other things). However this format is not generally displayed to the end user or required as input by Windows. Rather the Internet format (bob@corp.com) or the older Windows NT format (CORP\bob) is used for user interaction. Most of the Win32 APIs also only support the Windows NT format. My UserName class is useful for converting between the Internet and Windows NT formats but does not support the Distinguished Name format used by Active Directory. The reason is that you can convert between the Internet and Windows NT formats without any loss of information but there is not enough information in the name itself to convert to and from the Distinguished Name format. This is why the (very useful) TranslateName API has to have a connection to the directory service in order to work. My UserName class requires no connection to the directory service and also works on Windows NT 4, otherwise I would have just used TranslateName all the time. The other thing I would like to mention is that the process that attempts to create a new logon session (e.g. using the LogonUser API or my security classes) requires the SE_TCB_NAME (SeTcbPrivilege) privilege if you are running on Windows NT 4 or Windows 2000. This is no longer a requirement on Windows XP or Windows .NET Server. Also, depending on the type of logon session you want to create, the impersonated user may also require certain privileges.
Saturday, 17 August 2002The September issue of the C/C++ Users Journal features an article I wrote about managed C++. This is an adaptation of my original C# version of the same article.
Sunday, 21 July 2002I recently visited The Meeting House in Oakville. Check it out!
Wednesday, 17 July 2002In May I talked about some security related classes I had written in C#. I've since improved these classes quite a bit and I've also rewritten them in managed C++. After doing a lot of interoperability work in C#, and even writing an article about it, I've come to the conclusion that C# is just not the best language for this kind of thing (writing low-level system code). As you can mix managed and unmanaged code so well in C++, it turns out that writing it in managed C++ is a much better choice in most cases. Read More...
Sunday, 23 June 2002In my first weblog entry I announced the arrival of my son into the world, and today he turns 1. Happy birthday Joshua!
Thursday, 20 June 2002Joel has written a new strategy letter. He has some very interesting observations about microeconomics and how this helps to understand the reasons why many of the large hardware vendors are putting money behind open source or free software. Don Box gives another excellent talk, this time on the significance of virtualization in software systems.
Monday, 27 May 2002A certain someone, who shall remain nameless (OK it was Dale), commented that my weblog was getting boring because I didn't have any more time for it, what with my interesting job and all. Well here is some interesting new code samples that I'd like to share. One of my favourite topics is security programming. If you want to learn about security programming for Windows, Keith Brown has written an excellent book on the subject. This is one of my favourite books. Recently I needed to do some interesting things related to impersonation, and I wanted to do it from C#. Well the .NET Framework is incredibly rich, but it turns out it doesn't have much to offer in the area of managing Windows logon sessions and things like that. The security infrastructure in .NET is focused around such higher level concepts as code access permissions, role-based security and cryptography, and today this is where most of the focus is with distributed systems. But there are times when you still want to write low level code to do things like create logon sessions, fiddle with security attributes, and other such interesting things. The .NET Framework does not cater for this just yet. So I wrote a few handy classes that you can use in your own code. ImpersonateUser This class creates a new logon session for the specified user and sets the thread token to the token for the logon session. This is more commonly referred to as impersonation. It implements IDisposable so you can easily impersonate a user for the duration of an execution block and the class (with the help of the using keyword) will safely stop the impersonation and reset the thread token. If I run the following code on my machine:
I get the following output:
So the ImpersonateUser class is handy if you want to perform some action on behalf of a user. UserName One of the interesting things to notice about the code sample above is that I specified the principal to impersonate using the User Principal Name (UPN) format or the Internet-style name, rather than the traditional SAM or Windows NT form. This is achieved through the UserName class I wrote that easily converts been the two formats. The following code illustrates its use:
UserProcess And finally, if simple impersonation is not enough, then you may find the UserProcess class interesting. This class goes a step further than ImpersonateUser by creating a new process in the security context of the specified user. It does all the dirty work of creating a new logon session, loading the user profile for the logon session, creating the environment block and then tearing it all down when you're done. It supports many of the features of the .NET Framework's Process class such as redirecting the standard streams (input, output and error) so that the parent process can interface with the child process using these pipes (exposed as StreamReaders and StreamWriters). I would add a code sample, but there's so many things you could do that its probably best if you play with it yourself. And besides, this weblog entry is getting a bit long. Well I hope you enjoy playing with my security classes. Please let me know if you find them useful. Oh, you can download the code and binaries here. The Kerr.Security assembly contains the classes mentioned above and it references the Kerr.WindowsAPI assembly which provides wrappers for the Windows API functions used by the security classes.
Saturday, 4 May 2002If you've been trying to get hold of me using my Hotmail address, please forgive me if I have not responded. My Hotmail account is just swamped with junk mail. There must be something we can do about all the junk mail! Most of it is completely obscene. Anyway, if you're not getting a response you can try my work address. My email handle is kennyk at platespin.com. Sorry there's no anchor. I'm trying to avoid getting any spam in this account. I've read a few more excellent books: Microserfs by Douglas Coupland: An interesting story about a group of misfit Microsoft employees. More than just a story, its a rather deep look into the lives and thinking of programmers. You have to be a programmer to understand, but my wife also enjoyed reading it for its human side. The Mythical Man-Month by Frederick P. Brooks: This classic software project management book is a fascinating collection of essays written by Frederick Brooks. Based on his experiences managing large-scale software projects during the 50's - 70's at IBM. Despite all the advances in computer science, most of the challenges faced back then are still very much a part of our lives today.
Friday, 19 April 2002If you're still trying to figure out exactly what the difference is between Java and C#/.NET then take a look at this great interview with the designer of C#, Anders Hejlsberg, who by the way also gave us Turbo Pascal and Delphi!
Sunday, 14 April 2002I just realized that I've been on over 14 flights since September 2001, and I really hate flying. Since February I've visited Redmond twice and I've just returned from Tech·Ed in New Orleans. I'm so tired of traveling. I think I should just move to Redmond and be done with it! :) I have to say Tech·Ed was a bit of a disappointment for me. I had no idea what to expect as I've never been before. It turns out that it is mostly geared towards introducing developers and other technology professionals to Microsoft's current technology and tool offerings. The problem is that I've been working with Visual Studio .NET and the .NET Framework in particular since it was first released to public beta, probably around 2 years ago. There were two highlights however... I sat in on a talk by Don Box and I even got to meet him briefly. Repeat after me: G - X - A: Global XML Web Services Architecture. If you're like Sun and hate anything from Microsoft even if its inevitable and just makes sense, then go ahead and ignore GXA. But if you want to know what IBM and Microsoft are doing with web services to change the way we look at distributed systems, then give GXA a closer look. And just in case you're still confused, this is a lot more than just SOAP, but SOAP is certainly at the heart of it. The other thing you should check out is MOM, or the Microsoft Operations Manager. This is a really cool product that greatly reduces the burden of managing groups of servers. Vlad Joanovic, the MOM program manager, did a really great job of demonstrating the value of Operations Manager at one of the Tech·Ed sessions.
Thursday, 21 March 2002Icon Browser has been awarded the Windows Forms Coding Heroes award! GotDotNet: "Mr. Kerr has written a great article on resource management and wrote an incredibly useful Windows Forms app to extract and save icons from .ico files and unmanaged libraries. The article itself has a great section on interoping with unmanaged code using pinvoke."
Friday, 15 March 2002I recently finished reading The Hobbit and The Lord of the Rings by Tolkien. I don't usually enjoy these types of books, but I really enjoyed reading these two books. Its just amazing how Tolkien can carry the story for hundreds and hunderds of pages without the reader ever losing interest. I still haven't seen the movie though. I updated my book wish list. It should give you an idea of the types of things that I'm thinking about and interested in these days.
Sunday, 10 March 2002Joel Spolsky does a great job of telling us why we have to design before we code, even if Linus Torvalds doesn't have to. And if I haven't told you already, read Code Complete! As a software engineer, there is no better book that you could read. For years I've been telling people to read this book.
Tuesday, 19 February 2002 PlateSpin:
The company I'm now working for. I'm the Windows development
team lead. Microsoft: I spent a few days at Microsoft's campus in Redmond. I have even more respect for Microsoft than I did before. Its a great company and they have great people working there. And the campus is beautiful. VMware: An amazing tool I've just recently started using. Every Windows developer should have a copy of this on their machine. Its such a great way to do testing of Windows applications on all the many combinations of Windows versions, to name just one use it. Visual SourceSafe: I've been using SourceSafe for as long as I can remember. When you have a large database and developing for multiple platforms or are using multiple compilers its often the case that your working folders get a bit disorganised. I used to use a script that I wrote to clear the working folders, but recently wrote a little Windows Forms application called the VSS Working Folders Cleaner using the .NET Framework. More... CVS: I've started using CVS for my source control. I think SourceSafe is great and I've never had any serious problems with it. However many people use CVS and in particular most of the development teams at PlateSpin. So I've decided to standardise on CVS for the Windows development team as well. If you've only ever used SourceSafe, CVS can be quite a shock. Its a completely different paradigm. SourceSafe is centered around the concept of checking files in and out. Before you can edit a file you must check it out. This indicates to the SourceSafe database that you would like to modify the file and makes it clear to other developers that you have the file checked out. If you're smart you'll even go so far as to not allow multiple checkouts. CVS on the other hand has no notion of checkouts. From a SourceSafe point of view you could say that everyone has all the files checked out all the time. You can edit any file. The "source control" kicks in when you try to commit your changes to the repository. Interesting stuff.Monday, 4 February 2002I've started archiving my weblog so that my homepage won't grow out of control. You can find my Weblog Archives at the bottom of this page.
Sunday, 3 February 2002I've updated my Websites page. It now includes a list of interesting articles that you can read online. Here I will be keeping a list of only those really great articles that you absolutely must read if you care at all about software development. I will be updating this list quite often as I find all those articles that I've read in the past that have really impacted me. I'm trying very hard not to add every single article from Joel on Software. So check out his Article Archive. I've also updated my Bookshelf and in particular my Wish List.
Wednesday, 30 January 2002Resource Management in an Unmanaged World: After writing about resource management in the managed world of .NET, I thought it would be useful to talk a little bit about resource management in unmanaged C++ programming. In my Icon Browser article I illustrated why resource management is still vitally important in a world where the garbage collector reigns. When writing code in C++, resource management is just as important (if not more so), but rather more visible and obvious. Despite popular belief, C++ is designed to avoid direct access to resources such as heap-allocated memory. More... What is wrong with using C++ to teach kids how to program? So many universities are porting all there Computer Science programming courses to Java. Why!?!? Sure, programming at a higher level of abstraction is great for productivity. Not having to worry about memory allocation (yeah right) and pointers may reduce your bug count. But does it teach you how to be a good computer scientist? I don't think so. The beauty of C++ is that you can program at the level of abstraction that suites the problem you are trying to solve. If you're modelling people and cars and dogs, you can create classes to represent these things and use types like string and int to store their properties. If you need to write some very time-sensitive algorithm you can go down to the level of pointers and bits if need be. A programming language used to teach Computer Science should be able to illustrate object-oriented techniques such as data abstraction and polymorphism as well as how to program against the hardware you are running on. This is what C++ was designed to do. But C++ is too complicated and confusing to teach as a first language, I hear you say. Nonsense! Look at the following program. What's complicated or confusing about this?
I haven't included any comments in the source code but I'm sure you can figure out what's going on. If you're interested in learning C++ as a new language then you should give Accelerated C++ a try. While I'm on the subject, it seems that Java has gained popularity for what it is not as apposed to what it is. Its not controlled by Microsoft, therefore it must be good.
Wednesday, 23 January 2002I was just rummaging through some of my old projects and came across my old website from years back. This is back in the day when I was still spending most of my time building websites and web applications. As you'll see, I was quite mad about Dynamic HTML. So go check it out: Kenny's Little Web! A more interesting problem than Reversing a string in place, is to reverse the words in a string, and doing so without allocating any additional memory. Well I had to think about this one for a while. How do you move groups of characters (words) in place, especially since they can be of different lengths? More...
Sunday, 20 January 2002
This is a fascinating guide to the workings of the mind and how you can put it to work in creating ideas and solving problems. It is very practical and approachable, so you don't need a psychology degree to learn something from it. If you want to be more creative or want to know how to make your organisation more creative, you should read this book. I highly recommend it. Wednesday, 16 January 2002I've just given my website a facelift. I hope you like the new look! I also did some spring cleaning, getting rid of some old content. In particular, I no longer keep a photo gallery. With all the new photos of Joshua, this has become a huge task. Fortunately Karin is doing a great job of posting photos on her very cool website. So with all the changes to my site there's bound to be a broken link somewhere. If you spot one, please let me know! If you know me you'll know that I'm all about software. So most of my effort on my website goes into my Code Corner. So do check it out. Since I've spent most of the last year deep in .NET, most of the stuff is about .NET programming and C#. But you will also find goodies and articles about C++ (my native tongue) and other Windows development topics. Enjoy!
Tuesday, 8 January 2002Developing software is a team effort. So it is vitally important that everyone working on the project feels that they are part of the team. When I was working at Ixchange and GoldMine, things didn't always go smoothly, but I always felt that I was part of the team and I belonged. I could count on the other members of the team, and we stuck together. Because of this attitude that team is still together after all these years and still developing great software, despite much upheaval within Ixchange. I have been hard pressed to feel that same team spirit anywhere else that I have worked. If you have a strong team and your developers feel they are safe and secure within that team they will be more willing and encouraged to work hard and innovate. When retrenchments are looming, the team sticks together. Deals can be made. To avoid layoffs the team can agree to a pay cut until the economy picks up again. But if there is no team spirit everyone feels alone and vulnerable, they go on the offensive and then they can't be productive. So the moral of the story: build your teams and hold on to them. A good team is worth more than any one prize individual. For help in building great team environments read Dynamics
of Software Development and visit
Friday, 4 January 2002
Thursday, 3 January 2002Karin and I have been working on two new websites. Tanja's Creations is an online store where you can purchase cards, prints, etc. based on artwork by Tanja Ilsley. Kerr Frames is the corporate website for the company that produces Tanja's Creations. Both sites should be live within the next two weeks.
Wednesday, 2 January 2002Sorry, I had to pull the article. Will let you know when its back up. For more info please contact me.
Weblog Archives
|