Managed Debugging Assistants

I came across this MSDN article (May 2006) by Stephen Tolub on Managed Debugging Assistants (MDAs), a CLR feature I was unaware of. Useful article, especially if you are doing any P/Invoke work. MDAs “…provide information on the CLR”s current runtime state and on events that you as a developer could not otherwise access. Some even modify runtime behaviors to help expose otherwise very hard to find bugs.”

There is a listing of all Stephen Tolub’s MSDN articles here.

Excellent Meeting, Great Turnout

And I’m not talking about Sydney APEC conference! Last night’s Perth .NET user group presentation with speaker Nick Wienholt was excellent, and we had another great turnout (I counted 47 people). Here are a few photos of the meeting:



(Apologies about the quality of the photos, they aren’t the best; I have no excuses!)

After the meeting we went for a meal at ‘Arirang’, a nearby Korean BBQ restaurant. Good thing I took a couple of photos before the BBQ got fired up, as it got a bit smokey later on (as Dave will confirm!):

Thanks to Nick Wienholt for taking time out to give a well received, very informative and useful session, and thanks to everyone for attending. Hope to see you all in a month’s time. Speaking of which, we have another guest speaker signed up who is flying in from Sydney. I’m sure most people will know him. A clue to his identity might be the topic: An introduction to Visual Studio 2008.

Thanks to Excom for providing our monthly meeting venue.

Applied Mathematics for Database Professionals. Lex de Haan and Toon Koppelaars. Apress (Book Review)

Writing a book is no easy task. Completing a book when your co-author and friend passes away early in the process, must be a monumental task, this is what Toon Koppelaars achieved with this work.

I ordered this book expecting it to contain examples of using statistics, probability and data mining algorithms as applied to databases. In retrospect, I am not sure why I made that assumption. It is actually about formally specifying database designs using logic and set theory. This book is reviewed and endorsed by C. J. Date and features a foreword by him, which would be high praise for any book on the subject of databases.

It is split into 3 parts and 12 chapters as follows:
  1. Logic: Introduction
  2. Set Theory: Introduction
  3. More Logic
  4. Relations and Functions
  5. Tables and Database States
  6. Tuple, Table, and Database Predicates
  7. Specifying Database Designs
  8. Specifying State Transition Constraints
  9. Data Retrieval
  10. Data Manipulation
  11. Implementing Database Designs in Oracle
  12. Summary and Conclusions

If you’ve studied mathematics (or a tertiary subject with a mathematics element to it) you will most probably be familiar with the sections on set theory and logic. If you have not then they provide an as excellent introduction to these topics that you are likely to find anywhere.

This book makes the following claims and I have made comments against each one:

“This book will help you”:

  • “Become a better database designer. You’ll make fewer mistakes, and your designs will be more flexible in response to changing data needs.” I agree 100% that having a good, if not intuitive, grasp of logic and basic set theory will help you to create better DB schemas.
  • “Use the expressive power of mathematics to precisely specify designs and business rules.” I am not sure how useful this is, and I have a mathematics background. I personally feel that having another notation to express the database design seems to break the DRY (Don’t Repeat Yourself) principle.
  • “Communicate effectively about design using the universal language of mathematics.” I personally do not think this applies unless you are at the top of your game and/or have a theoretical bias and you are communicating with someone similar.
  • “Develop and write complex SQL statements with confidence.” Absolutely agree. I am often surprised at the number of software developers that do not have a thorough grasp of logic.
  • “Avoid pitfalls and problems from common relational bugaboos such as null values and duplicate rows”. Probably, but then 3NF will go a long way to achieving that.

I would be the first to agree that a good, basic mathematics grounding is desirable if you want to confidently design databases that scale well and are modelled correctly.

The mathematics that you learn in this book will certainly put you above the level of understanding of most database professionals. But I am not convinced that alone will enable you to better understand the technology and be able to apply it more effectively. It will help you to avoid data anomalies like redundancy and inconsistency, which are not uncommon problems in the world of databases!

On the whole, I enjoyed reading this book, but I’m not sure if I learnt anything I could immediately put to use when designing and refactoring databases. I did not put a great deal of effort into learning and understanding the formal database specification language described in this book purely because I could not see an immediate benefit when balanced against the effort required to learn a new notation, and I may well have overlooked something crucial that would indeed enable me to create better database designs.

Disclosure: The Perth .NET User Group is a member of the Apress User Group Program. Apress make copies of their books available for user group libraries, and the copy reviewed here was kindly donated by them.

Perth .NET User Group Meeting, 6th Sept 2007: Nick Wienholt

On Thursday, 6th September, come and join us at the Perth .NET user group where Nick Wienholt will be presenting a session on Real-world Code Generation, demonstrating there is more to code generation than simply spitting out a bunch of objects based on a database schema.

This meeting will take place at 5:30 pm at our usual venue of Excom Education, Level 2, 23 Barrack St, Perth. This is a free event and everyone is welcome to attend.

I have a few copies of “OpenXML Explained” to give away, and also a few “Visual Studio 2005 Accelerator kits” courtesy of Andrew Coates and Microsoft.

Process Monitor: RegMon and FileMon Combined!

FileMon and RegMon (originally from SysInternals) have long been essential debugging tools in every developers toolkit. [If you are unfamiliar with these two tools, they monitor and report file and registry reads and writes. They were essential in tracking down incorrectly set permissions or overwritten or missing registry keys]

RegMon and FileMon could produce a huge amount of process trace data and consequently had a learning curve to make them effective.

Until recently they were separate tools. They have been combined into Microsoft’s Process Monitor tool, which integrates the functionality of FileMon and RegMon into a unified debugger, along with numerous significant enhancements. Process Monitor’s user interface and options are similar to those of Filemon and Regmon, but it was rewritten from the ground up. The new tool has improved filtering options that preserve data, and better highlighting. Process Monitor logs processes and threads, collects more information, shows calling thread stacks for every event, and provides numerous ways to view collected data. The full list of enhancements is available on the download page.

Process Monitor (v1.21) is freeware and can be downloaded from http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx

Other useful links are the windows debugging tools (required for the symbols, if you want to examine system calls): http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

Mark Russinovich delivers an excellent TechNet video “Advanced Windows Troubleshooting with Sysinternals Process Monitor” here.