« ENet | Geek Speak Archives | General »

More thoughts on C++ Tools (on Windows)

| 2 Comments
Last friday's rant about C++ static and dynamic analysis tools was picked up by Reddit and I have had quite a few helpful suggestions for other tools to try. Thanks! Dr. Memory. Microsoft's Application Verifier. CPPDepend PVS Studio Microsoft's CRT Debug heap. CLang - various options, especially using AddressSanitizer.…
I tend to develop code with JITT (Just in time testing), this is like TDD when I'm doing it but it doesn't always get done. What does get done, generally, is the "first test" for each class. This ensures that subsequent testing is possible as the code doesn't have hidden dependencies and it gives me a test harness that's ready to go when I find that I need it. More complex code end up being TDD, easier bits end up as JITT where the tests are only written when I've wasted time banging my head on the desk trying to…

Hosting .Net Core in C++

| 0 Comments
One of the things that came out of my conversations with clients last night was an interest in hosting .Net Core from native code. Of course we already host the CLR and provide an easy way to write servers that do the heavy lifting in native code and call out to managed code for the business logic. We have several clients using this to host managed "plugins" inside a native host and it works very well. Hopefully hosting .Net Core won't be that different. It looks like you can skip the whole meta host thing and just load it…

SChannel ALPN support, documentation "bug"...

| 0 Comments
I'm looking at adding support for the TLS Application-Layer Protocol Negotiation Extension to The Server Framework as a precursor to looking into HTTP 2.0 support. This TLS extension is supported by both SChannel and OpenSSL. It's relatively new (only having been included in SChannel since June 2014 (!)) but there seems to be no documentation on MSDN for the structures and how to use them to add the appropriate entries to the TLS handshake and then to select and validate the protocol of your choice... Searching today with Google for something like "SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT" just gives just the usual selection of hits…
I now have a real solution to the problem that I outlined on Saturday night and this solution, unlike the one developed during my "Macallan driven development" session on Saturday evening actually works. The problem is that when using code to run build using VS2010 by running a project into devenv.com I get the following error message: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(214,5): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v12.0.dll". Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v12.0.dll' or one of its dependencies. The system cannot find the file specified. The project builds correctly from the command…
Updated: 12 July 2015 - It seems that this is all incorrect... Upon running my tests again this morning I find that the x64 task runner also fails to run VS2010 correctly and so the environment differences are unlikely to be the cause... So, having decided that my continuous integration system could be better, and having looked at JetBrains' TeamCity and decided that it doesn't quite fit I'm looking back at some code that I wrote back in 2008 when I last thought about this kind of thing... I have some code which works with trees of dependant tasks and…

Bug hunting

| 0 Comments
I've just spent a day tracking down a bug in a pending release of The Server Framework. It was an interesting, and actually quite enjoyable, journey but one that I shouldn't have had to make. The bug was due to a Windows API call being inserted between the previous API call and the call to GetLastError() to retrieve the error code on failure. The new API call overwrote the previous error value and this confused the error handling code for the previous API call. This was a bit of a "school boy error" and it was made worse by the…
Back in September I mentioned that I had found a problem with my usage of Slim reader/writer locks. I expected this to be something that I was doing wrong but it turned out that it was a kernel bug. This morning Johan Torp tweeted that a hotfix for this issue is now available. The note on the hotfix states: "Note These issues are not obvious and are difficult to debug. This update is intended for applicable systems to apply proactively in order to increase the reliability of these systems.", so go install it even if you don't know that you're…

Video streaming from IoT devices

| 0 Comments
As I mentioned back in February I've been working on a custom video streaming solution for one of my clients. This has been a lot of fun. It was a nicely defined spec using industry standard protocols developed on a fixed price basis with lots of TDD, what's not to like. The system allows a controlling application to set up RTSP streams for broadcasting to multiple clients. The data for the stream is being transmitted live from one of thousands of smart (IoT) devices and the server buffers this and broadcasts it using RTSP to publish the RTP streams. The…

That Slim Reader/Writer lock issue is a kernel bug

| 0 Comments
It looks like the Slim Reader/Writer issue that I wrote about back in September is a kernel bug after all. Stefan Boberg has just tweeted to let me know that Microsoft has confirmed it's a bug and that a hot fix is in testing.…

Two quite different approaches to multi-threading

| 0 Comments
I've been working on some code for a client recently that needs to run in a multi-threaded environment. Unfortunately it was never really written with that requirement in mind, or, more likely, the people who wrote the code knew that it needed to be accessed from multiple threads but didn't really understand quite what that meant. As such I'm doing some fairly hairy refactoring for them. It's high risk as there are no unit tests and the budget doesn't really extend to completing the work, let alone "spending extra time" writing unit tests... The code is written in quite a…

How to build a GCC Cross-Compiler

| 0 Comments
This article over on Preshing on Programming looks useful. It gives a step by step guide for building GCC cross-compilers, I expect it will save me lots of time at some point in the future.…

Surprising Slim Reader/Writer Lock thread exit issues.

| 1 Comment
I've been noticing a strange thing for a while on Windows 8/8.1 and the equivalent server versions. The issue occurs when I'm using a Slim Reader/Writer Lock (SRWL) exclusively in exclusive mode (as a replacement for critical sections). What happens is, when a thread that has just unlocked a SRWL exits cleanly, immediately after unlocking the lock, sometimes threads that are waiting on the lock do not get woken and none of them acquire the lock. At first I spent ages thinking that this was some kind of subtle bug in my LockExplorer tool as initially the problem only manifested…

Activatable Object

| 0 Comments
I've written an article for Overload, one of the the ACCU's journals. It's based on my Efficient Multi-Threading blog post from a few weeks ago. Chris Oldwood mentioned to me about how the object described in Efficient Multi-Threading was similar to an Active Object which steals a calling thread to do its work rather than using one of its own and I agreed, he then suggested that I write it up for the ACCU journal. You can read the article here.…

Efficient Multi-Threading

| 0 Comments
Performance is always important for users of The Server Framework and I often spend time profiling the code and thinking about ways to improve performance. Hardware has changed considerably since I first designed The Server Framework back in 2001 and some things that worked well enough back then are now serious impediments to further performance gains. That's not to say that the performance of The Server Framework today is bad, it's not, it's just that in some situations and on some hardware it could be even better. One of the things that I changed last year was how we dispatch…
There are a couple of undocumented Visual Studio compiler switches which can be useful occasionally: /d1reportSingleClassLayout - which produces a dump of the in memory layout of a given class /d1reportAllClassLayout - which does the same for ALL classes See here and here for more details. And if you liked that, you might find this collection of debugging tricks interesting.…

Intrusive C++ containers

| 0 Comments
Recently, whilst continuing to improve the performance of various aspects of The Server Framework, I reached a point where I found I needed to replace some STL containers with intrusive containers which didn't need to perform memory allocations during data insertion and removal. I had been toying with the idea of implementing custom containers for some time but have only recently had a pressing need for them. The STL provides some marvellously usable code which has changed the way people view container classes in C++. The result is that you hardly ever need to write your own containers as the…
Today I discovered that C++ scoped static initialisation (function level) in Visual Studio is not done in a thread safe manner. It's the kind of thing that I should have already known but I guess I assumed that since namespace level static initialisation was safe so was function level static initialisation. Unfortunately it's not. If you read the MSDN documentation in a particular way you could decide that the docs say that it's not; but it's imprecise and unclear and I doubt that I did read the MSDN documentation anyway. Looking at the generated code from Visual Studio 2013…

TIME_WAIT perfmon counters

| 4 Comments
I've built a small Windows Service which exposes perfmon counters to track sockets in TIME_WAIT state. It can be downloaded from the links later in this post. Back in 2011 I was helping a client look for issues in their systems caused by having too many sockets in a TIME_WAIT state (see here for why this can be a problem). This was affecting their connectivity. Rather surprisingly there seemed to be no way to track the number of sockets in TIME_WAIT using perfmon as there didn't seem to be a counter exposed. A counter would have been useful so…
It seems that isprint() is broken. The following program demonstrates the problem. In VS20013 it prints "test failed" in all previous versions of visual studio it prints "test passed". From this reference: http://en.cppreference.com/w/cpp/string/byte/isprint it seems that VS2013 is broken. I've opened a Microsoft Connect issue for this. #include <ctype.h> #include <iostream> int main() { int c = 9; if (isprint(c)) { std::cout << "test failed" << std::endl; } else { std::cout << "test passed" << std::endl; } return 1; }…

See what process is using a TCP port in Windows

| 1 Comment
I have clients asking me about this all the time. This article is pretty concise about the tools that you need to use to map an open port to the process that has it open.…

The perils of "home office" RAID 5

| 0 Comments
I've had a little stand alone RAID device for several years now. It's a Netgear ReadyNAS NV+ and it works quite nicely. I'm sure I could have something better but, I haven't yet upgraded it apart from adding some memory and changing drives every now and then. I have a second ReadyNAS at my dad's office and my office backs up critical data to that via rsync and a VPN; the one at his end does the same, though most data flows from me to him. I have a third ReadyNAS that I use as a Subversion server (only…
A note to myself and my clients more than anything else... It seems that when you generate a key using a 1.x version of the openssl utility the blob looks like this: -----BEGIN ENCRYPTED PRIVATE KEY----- MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI7BZmHKzGwtQCAggA etc... T+CaOPXRod3cKwZEgp0vkM+gpsLw0C6WVEdV01ZrgUsJ2DceYXaenHCjfZ7jwy84 LKk= -----END ENCRYPTED PRIVATE KEY----- whereas when you generate a key in exactly the same way with an 0.9.8 version of the utility the blob looks like this: -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,061B6446EB96A47B OFE9asOb689P0l6++Nwz0HYop4KdgKh6NFCzZV/kjp03VL2RW6beii2x70ikTLjs etc... Av0yRECeV+1ztYamAAYbniTeVsYaim07tBWadVFjYZqr+cOwDz/3ZPAn51/179j2 -----END RSA PRIVATE KEY----- I'm sure someone who understands this stuff more than I do will be able to tell exactly…
The Server Framework's OpenSSL Option Pack integrates OpenSSL with my high performance server tool kit and gives you an IOCP based client or server that can handle many thousand concurrent connections with very few threads. The OpenSSL Option Pack has been around for over 10 years now and, as well as the SChannel Option Pack provides an easy way to add SSL or TLS to your clients and servers. The one problem with OpenSSL is building new releases. It's probably just me, but I like to have both x86 and x64 libraries in the same directory with different names…
Ah, sometimes I just love that younger me for getting to the point... More here, thanks to Daniel Tarbotton for reminding me of things I said in the past... And, for a change, it seems that someone agrees! ;)…
As I mentioned yesterday, I'm running Windows Server 2012 RC with my Intel 10 Gigabit AT2 adapters. I've had several emails asking me where I got the drivers from as the latest Intel drivers do not install. Whilst it's true that you can't currently run the downloaded driver exe, PROWinx64.exe on Windows Server 2012 RC (or anything later than Win7). You CAN unzip the exe (it's just an executable zip file) and then simply use the device manager to update the driver and then browse to the directory that you unzipped the exe into. I'm sure updated drivers that…
I'm still working on my investigation of the Windows Registered I/O network extensions, RIO, which I started back in October when they became available with the Windows 8 Developer Preview. I've improved my test system a little since I started and now have a point to point 10 Gigabit network between my test machines using two 2 Intel 10 Gigabit AT2 cards wired back to back. My test system isn't symmetrical, that is I have a much more powerful machine on one end of the link than on the other. This makes it somewhat complex to really push the…

C++ 11, Concurrency

| 0 Comments
I've been watching Bartosz Milewski's C++ 11 Concurrency videos and they're a pretty good way to get up to speed on the new threading support in the latest C++ standard. They start off nice and slowly, for people who haven't been doing concurrency for years, and explain the various new features provided by the language. It's good stuff. I've been reading Anthony Williams' C++ Concurrency In action which is a great way to understand the details of what you'll see in the videos. It's a good book and there's lots of useful stuff in there even if you've been…

The new Windows Azure looks good!

| 2 Comments
I must admit that I didn't really see how Azure could be of much use to anyone except really die-hard, bleeding edge, Microsoft only shops; that is up until yesterday. The new Azure, which you can read about here on Scott Guthrie's blog, seems much more usable for general purpose cloud solutions. Durable VMs, Linux VMs, easy migration to/from your own non Azure VHDs, direct access to their new low latency distributed cache from Memcached with no code changes necessary, lots of great new tooling and a REST based management API. What's not to like? I'm expecting lots of…
The best thing about Visual Studio 11 is that it doesn't matter if you like the new style IDE or not. The project files are, at last, backwards compatible, so you can load them in Visual Studio 2010 and build with the new tool chain even though you ignore the new IDE - if that's what you want to do. I don't like the new icons, but I find I can work fine in the IDE as long as I don't think about it too much... Probably pretty much like how I felt about all previous versions when they…

RFC 6455: The WebSocket protocol

| 0 Comments
I know I've said this before, but now it's really done... The WebSocket protocol is now an official RFC. There are a small number of changes between RFC 6455 and the draft WebSocket protocol version 17; the only important ones being he addition of two new close status codes. The rest is just a case of tidying up the draft. There will be a 6.5.3 release of The Server Framework to include these changes.…

I guess this is a geek thing...

| 0 Comments
I'm just back from a wonderfully relaxing holiday in Italy. This time we had internet connectivity all the time, so I'm up to date on email, etc. The first thing that I do after all the 'we're back, how's the house, and you need to go to bed even though you're excited to see all of the toys you've missed' stuff is to fire up all my machines and make sure that they do their windows update stuff... Then the NAS devices need to be started and allowed to settle in, then the VPN needs to be checked, dyndns kicked, etc. I…
I've been working with the WebSocket protocol recently, updating the code that implements the protocol in The Server Framework to the latest version of the draft standard (the HyBi 09 version). Whilst this looks like it's almost a real standard, there are still lots of potentially open issues as can be seen from the HyBi discussion mailing list. It's quite clear from some of the less cohesive parts of the draft spec (and more so from the mailing list) that the protocol is very much a design by committee effort. This is both good and bad: It's good that the protocol…
I have a client who is possibly suffering from TIME_WAIT accumulation issues and I thought that the best way to find out for sure was to get them to add the TIME_WAIT perfmon counter to their normal counter logs so that we could see how and when sockets in TIME_WAIT accumulate on the machine. The problem is that there doesn't seem to be a perfmon counter for this, which is unfortunate, especially since you can easily get the number of established and reset connections from the TCPv4 and TCPv6 performance objects. Since all of this information is available by…
After a week or so of serious dog fooding I've finally got a nice reliable lock inversion detector running as part of my build system for The Server Framework's example servers. Note: the deadlock detector mentioned in this blog post is now available for download from www.lockexplorer.com. The build system has always run a set of 'black box' server tests for each server example as part of the build. These start up the example server in question, run a set of connections against it and shut the server down. This proves that the example servers actually work and has also proved a…

WinRM/WinRS job memory limits.

| 1 Comment
My tangential testing that began with my problems with commands run via WinRs during some distributed load testing are slowly unravelling back to the start. I now have a better build and test system for the server examples that ship as part of The Server Framework. I have a test runner that runs the examples with memory limits to help spot memory leak bugs and a test runner that checks for lock inversions. My test scripts are also more flexible and I've found a couple of bugs. Today I used a variation on my job object based memory limiting test runner to…

WinRM/WinRS job memory limits?

| 3 Comments
I've had one of those days. In fact I've had one of those days for a couple of days this week... It started when I decided to improve the profiling that I was doing on a new memory allocator for The Server Framework by extending the perfmon and WinRS based distributed server testing that I wrote about a while back. This allows me to create a set of perfmon logs, start a server to collect data about and then start a remote client to stress the server. Some simple batch files make it extensible and repeatable and once I get a handle…
I'm still considering my options with regards to intrusive containers to replace the STL maps that I'm using in my timer queue implementation. I think I may be able to use the boost::intrusive sets in place of a true map in most of the situations that I need (I just have convince myself that a) it will work with all the compilers that I need to support, b) that adding a dependency to part of boost is a good idea for me and my clients and c) that even though my gut reaction on seeing the code is that it's…

Useful Visual Studio retirement matrix

| 0 Comments
Here's a useful matrix which shows when each version of Visual Studio will become unsupported by Microsoft. I'm posting the link here as I'm sure I'll not be able to find it the next time I need it...…

Invasive containers

| 1 Comment
Rather than immediately dive into the fun of writing my own invasive alternative for std::map I decided to take a look at what has been done before, as expected boost contains something that might work in the shape of the "intrusive containers library". Of course, being part of boost I first have to work out exactly how much more of boost it will require me to depend on and then I have to work out how I can use it to replace my current std::map usage. It seems quite clever (no surprise there) and allows for a type to be…

STL allocators, hmm...

| 3 Comments
As I mentioned a while ago, I have some code which needs to perform better than it currently does and one of the areas that could be improved upon is the amount of contention for the heap that's occurring. The fact that I'm using an STL map for my collection means that the class has a 'big C' contention value of C(n threads using the heap) rather than C(n threads using the object). Of course, the fact that allocations need to be done at all is an unfortunate feature of std::map but rather than immediately replace the container with an…

Tool lag

| 6 Comments
One of the problems of having a collection of tools that interoperate is that there's often a lag between when a tool will interoperate with the latest version of another tool. I'm hardly a bleeding-edge tool junky, I wait until RTM before I start using the latest Visual Studio on a daily basis, and in the case of VC 6 I stuck with it (as did most of my clients) until VS2005 came out and actually improved life for unmanaged C++ development... However, it seems that some tools take a long long time to catch up with Visual Studio. Take…

Amusing bug in GetTempPath()

| 0 Comments
Yesterday I had a bug report from a client who had a user that was getting an exception report from their software which simply said "GetTempPath() - Failed to get temp path". Now as error messages go this isn't the best but it comes from some code that has been in my tools libraries for around 10 years and which has never failed before, it has no tests, we're probably lucky that the message didn't just read "TODO" as I'm pretty sure that it's the first time that anyone has ever seen it apart from by reading my source code…

More thoughts on Big C

| 2 Comments
I'm finding that the thread contention notation that I made up the other day to help me talk about the performance implications of the changes I was making is pretty useful. The definition needs adjusting slightly though... For a given lock the worst case contention is C. For an operation involving a single lock where t threads exist during the lifetime of the process and n threads access the lock the contention for the lock can be expressed as being C(n). This is simple enough and means that C(1) is no contention on a single lock as there's only one…

STLPORT 5.2.1 AND VS2010 AND X64

| 7 Comments
I have been updating some client code to VS2010 and they use STLPort for the STL as it has better performance in multi-threaded situations than the version that comes with Visual Studio (see here). This has meant that I've needed to build STLPort 5.2.1 with VS2010 for x86 and x64. As with my previous builds of STLPort the compiler isn't currently officially supported so I had to hack my installation to get it all to build, etc. The changes are similar to those required for getting VS2008 to work with STLPort 5.1.5 (and 5.2.1) see here for details of those.…
This is a handy tip from Jim Beveridge. It shows you how to add to the list of native function calls that the debugger steps over rather than into when you're debugging in various flavours of Visual Studio. I wonder if the debugger picks up changes to the registry key whilst VS is running, if so there's scope to build a little add-in that lets you add to the list from within VS...…

The joy of hacking

| 0 Comments
Today I had a day which I knew from the start would be broken up due to pre-arranged calls and meetings out of the office, and so I decided to deal with a few low importance items on my todo list. One of them was to do a proof of concept for a new tool that I might work on. I had a thoroughly enjoyable time hacking an old tool into shape so that I could use some of the technology in the new tool. This was good old fashioned 'no tests', 'no rules', cut'n'paste and force it to do…

DevPartner Studio 9.1

| 0 Comments
I've complained about DevPartner Studio enough in the past (here, here, here, etc.) that I thought I should write a positive blog posting since my recent experiences have been very positive. Some time ago I reported a bug in the BoundsChecker part of the product which meant that it hung sometimes in multi-threaded code. I managed to get a reasonably straight forward reproduction and raised an issue with them. It took a while but this is now fixed in 9.1 and this alone makes the product much more usable for me - having your diagnostic tool hang is never that…

Writing a custom Wireshark dissector plugin

| 3 Comments
I've been spending a little time recently writing a custom Wireshark dissector plugin for the UDT protocol. This didn't prove to be that difficult once I got over the initial problem of actually getting the Wireshark source to build with VS2008. My problem was that I'd found a CodeProject article which is now slightly out of date and which I followed too closely - setting up the Platform SDK version that the article stated was required. In fact the source code has moved on since then and now needs a later version. Eventually I switched to using the latest Platform…

Concurrency profiling with VS2010

| 0 Comments
I'm currently looking at the new concurrency profiling tools that come with Visual Studio 2010. It's interesting and useful stuff. The tools provide what I have attempted to develop in the past by using API Hooking but it's vastly superior in speed and functionality. One of the big problems for me with my API Hooking concurrency tools (Deadlock detector and Lock Explorer) was that the instrumentation often caused the target process to run pretty slowly. There seems to be none of that with the concurrency tools in VS2010. The target process runs very nicely whilst it's being profiled and the…

The equivalent of static libraries in .Net

| 2 Comments
I'm building my managed XLL tool in two versions, a 'normal user' version and a 'pro' version. The 'pro' version has additional features that I don't feel would necessarily appeal to all of my potential users; things such as easy Excel RTD server support and Asynchronous worksheet functions. The fact that the core code is identical between the two versions has caused me a little trouble as I want to package the code in a single assembly and, although it's all C++/CLI, I can't work out how to build the common code in one project and link it with each…
Has anyone got anything to say about the relative merits of Parasoft Insure++ vs the BoundsChecker parts of the Microfocus DevPartner Studio product? I've used BoundsChecker for a long time, and it has plenty of faults but the fact that all support channels seem to have vanished during the transition of the product from Compuware to MicroFocus means that I'm now considering moving to something else. So far my impression of Insure++ isn't being helped by the fact that the sales person seems to require a 'land line' to contact me on to enable them to talk to me about…

A week with Windows 7

| 7 Comments
I upgraded one of my build machines to Windows 7 almost a month ago now but I only managed to get around to doing my main developer machine at the start of this week. Apart from the fact that the Windows 7 in place upgrade failed on me, twice, and rolled back to Vista without leaving me with much information as to why it had failed (removing Compuware's DevPartner Studio did the trick), the upgrade went pretty smoothly. Having used the machine for a week now I can say that there's nothing that I'm complaining about (yet) and that in…

Using old compilers

| 2 Comments
By an interesting coincidence I happened to be searching for a few new C++ blogs to follow and I also happened to have just updated this entry about Stan Lippman's VC6 rant (since I found a link to the original posting which had been deleted before I could comment on it back in 2005...). Anyway, back to the point, The Lone Coder asks "Why oh why do people insist on using compilers that are way out of date?". My answer is pretty much the same as back in 2005; clients often require that code builds with older compilers and that…
Back in October 2005 some of my clients started to complain that the latest version of the Platform SDK (the April 2005 version) broke their builds. The culprit was uuid.lib which had been built with debugging information that the VC6 linker didn't understand and which caused a link failure. The end result was that the last version of the Platform SDK that worked with VC6 was the February 2003 version. This all seemed quite unnecessary to me at the time; as if the latest Platform SDK was deliberately unusable for VC6 which had (in September 2005) just become unsupported. Well,…

Downloading Windows 7

| 0 Comments
Since I complained about how the Microsoft File Transfer Manager sucked when I was downloading the Windows 7 Beta back in March I thought I should be balanced and point out that last night I kicked off a download of Windows 7 and the x86 and x64 SDKs and this morning they were all present and correct and that I had none of the problems that had plagued me last time. I was just thinking that perhaps Microsoft had beefed up their connectivity prior to the launch on MSDN subscriber downloads when I got a comment from Nigel to my…

A time and a place for comments

| 0 Comments
I'm fairly set in my ways about the value (or lack of) of comments in C++ code. I tend to have very few comments in my code and I tend to favour names and structure over comments; names and structure compiles and doesn't lie. Sometimes I go too far in that direction and I'm forced to fight with some of my old code and at that point I might add a comment that explains the non obvious but I'm more likely to attempt to refactor the code into something where the names and structure tell the story better. However... I…

Globals are evil

| 0 Comments
Jamie Fristrom over at GameDevBlog thinks that "Globals are underrated". I disagree, and, agree with most of the comments that Noel makes; globals and their 90's equivalent, singletons, are evil. As anyone who has looked at the code that I present on my blog knows, I tend to favour 'prarameterise from above' in my designs. That is code that doesn't reach out to a global for something but that only works with what it has been given. This leads to you passing a fair number of references or pointers to your objects. In a later post, Jamie points out that…

Why not to compile as 64 bit...

| 0 Comments
Here's a nice piece by Rico Mariani about why Visual Studio is unlikely to go 64 bit any time soon. In a nut shell, unless you have very large data sets that need to be kept in memory you might be worse off as a 64 bit process than you are as a 32 bit process on a 64 bit operating system. Food for thought.…
Eric Lippert has an interesting blog posting (here) on how sometimes you can be so focused on fixing the bug you fail to step back and take a better look at the actual problem that you're trying to solve. I'm guilty of this and, with me at least, it doesn't only apply to bug fixes. Sometimes I can become overcommitted to a design to the point where I don't recognise that it's just one design option I treat it as the only design option. I suppose it's to be expected, especially when you've already committed a lot of thought to…

#pragma unmanaged

| 0 Comments
I've just spent a little too long trying to track down a bug in a mixed mode DLL that I'm building. The DLL exposes a set of entry point functions that are defined as taking a single pointer argument and lies to the application that hosts it so that the application can call it with various numbers of arguments. The arguments could change from call to call or from 'session' to 'session'. This all works fine thanks to the wonders of __stdcall and the fact that my DLL knows what arguments to expect and so can unmarshall them correctly by…
I'm currently wrapping a server's client side API in an ATL COM object for a client. The COM object will be used to communicate with the server from managed code or VB or other COM compatible systems. It's a fairly straight forward process as the original 'C' DLL interface client API was built with this kind of thing in mind and I've done enough C++ objects wrapping a 'C' API conversions in the past to make the whole process relatively painless and straight forward. However, there's always something... I'm running the code through my automated build process before release and…

Embedded assembly programming

| 0 Comments
Well, I've finally done something that I've been meaning to do for a long time. I've written some non-trivial assembly language code. Up until recently I wasn't expecting this to be embedded assembly, but it actually seems like a sensible way to get into this low level stuff. Programming an 8bit RISC microcontroller in assembly is considerably easier than trying to do something with a PC. The chips are cheap (as chips), the tools are free, there's an active user community and the electronics required is relatively simple. Right now the code is heavily based one someone else's code; but…
I'm in the process of upgrading another client to v6.0. These guys write multi-user game systems and have a fairly complex CLR hosting custom application server. Anyway, I was hoping that we'd have a few easy performance wins from the changes that have gone into v6.0 and these gaming guys are possibly even more hung up on performance than my banking and trading clients. The good news is that the changes in how we convert numbers to strings has drastically improved performance in their debug builds where they have lots of logging going on. The bad news is that performing…

Interesting piece on thread pools

| 0 Comments
Herb Sutter has just published an interesting article over at DDJ on correctly using thread pools: Use Thread Pools Correctly: Keep Tasks Short and Nonblocking. It's not rocket science and it doesn't deal with platform issues but it's a useful summary of why The Server Framework's thread pools operate as they do. Note that on Windows you can use IO Completion Ports to manage the work queue into the thread pool and this can keep the number of threads that are scheduled to run at the optimum number so that the pool operates at the 'correct load' for most of the time…

Breakpoint sequences...

| 1 Comment
Something that I find myself wanting in a debugger from time to time are breakpoints that only fire if the code has been entered via a specific route. You know the problem, you've tracked a particular issue down to one specific call sequence that occurs at a specific point in the code. The line you want to break on in this instance is also hit a lot via other routes that you don't care about. I find myself setting a breakpoint higher in the call stack that I'm interested in and then when I hit that I switch to the…

Living with Subversion

| 0 Comments
It's now around a month since I started shifting the bulk of my source code from CVS to Subversion. In that time I've move most of my internal use code, and a couple of clients. I've done several client releases and developed several new features for The Server Framework on isolated development branches which have then been merged back in to the main trunk. I've also updated my continuous integration server to use the new source code repositories and, generally, just got on with it and lived with the new system. Overall I like it; not least because the NAS that runs…
Converting a numeric type to a string format in C++ is one of those problems that was 'solved' a long time ago. The 'standard' method usually involves streaming the type to be converted into a std::stringstream and then extracting the resulting string representation. Something like this, perhaps: #include<iostream> #include<string> #include<sstream> using namespace std; string itos(int i) // convert int to string { stringstream s; s << i; return s.str(); } int main() { int i = 127; string ss = itos(i); const char* p = ss.c_str(); cout << ss << " " << p << endl; } This style of…

More code shuffling...

| 2 Comments
The CVS to SVN code migration is going well. As recommended by a commenter I've switched from using a script to pull my tools libraries from their repository into The Server Framework examples build tree to using svn:externals. This works nicely and plays well with branches and tags (as long as you remember to update the svn:externals definition on your branch or in your tag so that it points to the correspondingly tagged version of your externals (but this would have been the same if I were using a script). Using externals isn't perfect mind you; although the externals are automatically processed…

The great source code shuffle...

| 10 Comments
I'm in the process of moving my source code from a CVS repository to Subversion. The main reason for the move is so that I can move the repository onto one of my NAS devices so that it can be backed up automatically. I have a spare NAS due to the fact that I had a power supply fail and the fastest way to get up and running again was to buy a new one rather than waiting for the replacement PSU... Anyway, the development NAS has SVN running on it which means that I now have a RAIDed, UPS…

Comments are back on...

| 0 Comments
The move to the new hosting server is complete and all the perl config has been done so I've turned comments back on!…

DevPartner Studio 9.0

| 8 Comments
I've just updated my installation of DevPartner Studio. I mainly use the C++ error detection part of this suite, that's the bit that used to be called BoundsChecker. Anyway, version 9.0 is the first version to support VS2008 and x64 so I was quite excited to be able to run the tool on my dev box rather than on my old x86 dev box. Unfortunately my first impressions aren't good. Here's some of the output from the build window whilst the build is being built for "Error detection". Note the garbled output from some of the "Instrumenting" lines... This looks…

/Wall

| 0 Comments
I've been compiling with /W4 for some time now. I didn't realise that this wasn't the best you could get. There are some warnings which are not enabled by default and therefore aren't included in /W4. To enable these you need to specify /Wall. The list for Visual Studio 2008 is here. Obviously there are some warnings that I don't find that useful, but these can either be disabled as and where I need to with #pragma warning or globally in my 'Warnings.h' file... Thanks to Maciej Sinilo for the heads up on this.…

STLPort 5.1.5 and VS2008 and x64

| 2 Comments
I've been meaning to build STLPort for Visual Studio 2008 for some time now but as the STL support that ships with Visual Studio has been improved the urgency to be able to use an alternative has reduced. Unfortunately STLPort 5.1.5 doesn't build for VS2008 out of the box so it wasn't simply a case of downloading it and building it. Anyway, I asked a question about it on StackOverflow and got an answer which linked to a blog posting from someone who had hacked the VC8 build to work with VC9. Fixing the build properly isn't much harder than…

WM_TIMECHANGE broadcast strangeness...

| 3 Comments
I'm currently writing and testing a simple class that watches for system time changes. This is to allow an app to adjust some timers that it sets for absolute times in the future if the system time changes. The code's fairly simple. The system automatically broadcasts a WM_TIMECHANGE message to all top level windows whenever something adjusts the system time or the time zone so all you need to do is write code that creates a hidden window and deals with the message. Testing this was proving somewhat tricky. On my Vista development box I found that trying to broadcast…

Lock free code is hard

| 0 Comments
There's an interesting article over on Dr. Dobb's about why writing lock free code is so hard. Herb Sutter takes some code from an article that Dr. Dobb's published a couple of months ago and pulls it apart and points out the problems.…

Good technical blog

| 0 Comments
I stumbled on Gustavo Duarte's blog this week via this post about how lucky we are to be programmers. The post that led me to his blog is good stuff and has had lots of linkage this week. The rest of the blog is also good stuff; I especially like the "Reality Driven Development" post which fits nicely with my "thin thread of functionality" way of designing software. I've always tended to design from the bottom up and my testing addiction has fuelled that somewhat; but I do still like to pop up to the surface on regular intervals and…

Interesting blog

| 1 Comment
I found JP's blog whilst googling for some information on RVA forwarders in PE files. There's lots of good stuff there about reasonably low level Windows development, debugging, testing and API hooking. Recommended if you like the kind of stuff that I write about. In addition to the blog postings JP has produced cfix a unit testing framework for C++. I haven't had a chance to look at it too deeply yet, but the documentation looks good and the source is available from SourceForge under the GPL.…
Back in October 2007 I sumarised my findings from getting my Win32 DebugAPI based debug engine working on x64. One of the strange things that I found at the time was this: When running a CLR app under the Win32 debug interface you only ever seem to hit the native entry point if you're running under WOW64. In all other situations you don't hit the native entry point ever. If you rely on it to pause your debug tools once the process is completely loaded and ready to roll then you need to stick a break point in _CorExeMain in…

Spam gone...

| 2 Comments
The endless torrent of bounce messages began again yesterday evening. Once again it was arount one email every 2 minutes or so. I turned on my laptop this morning expecting a few thousand emails to download and only a third of them to be correctly classified as spam by Outlook... There were a few, but, probably, under 10. There was no other spam either... Two legitimate email messages... It was, well, rather strange. Of course this didn't seem right. I sent myself a test email and that worked. I checked the webmail interface and the mailbox was really empty. I…

What would I do??

| 0 Comments
There's an entry over on the Dr. Dobbs blog about testing and how you make sure that your tests are testing the right thing; effectively, who tests the test. There's a question at the end "What do you do?" and I think my rather pithy, I've had some wine, answer is, "I think harder". The poster laments the fact that if you're doing TDD then the test fails first and then you write the code and then it works and therefore you know the test is testing the correct thing but if you have existing code then, well, it doesn't…
There's an interesting article over on the Dr. Dobbs Code Talk blog; PQR - A Simple Design Pattern for Multicore Enterprise Applications. It documents a design that I'm pretty familiar with and one which has worked pretty well for me in the past (this project was built in this way, for example). My variation on this idea is that it all tends to be in one process. Work items are passed from one 'processor' to another via queues and each processor can run multiple threads to process multiple work items in parallel. In simple systems you end up with a…

It seems I'm not the only one...

| 0 Comments
It seems I'm not the only one to make mistakes with GetTickCount() based timer code, see: System.Threading.Timer fires immediately when specifying a large value for due time.…

And then there were three...

| 0 Comments
This morning a new Ready NAS NV+ unit arrived, so now I have three. I didn't have a sudden change of heart about buying a development box, the power supply in my office NAS died on Thursday afternoon and buying a new, bare, enclosure was the quickest way to get my existing disks back online. However, once I get the faulty until returned from repair I'll have a unit that I could develop on...…

ReadyNAS development...

| 0 Comments
As I mentioned a while back I'm using a pair of ReadyNAS NV+ RAID systems as my on-site data store and off-site backup. These are both working well and I'm pleased with the solution. After a few hickups and delays due to the Netgear takeover of Infrant it seems that the firmware is developing nicely again and the latest thing that I've discovered is that you can now develop and deploy your own code to the devices (if you're brave enough!). See here for details. Given that I'd need to purchase a third unit as a development and testing box…

Bug in timer queue code

| 0 Comments
Whilst I've been away I've had a bug report for the TDD timer queue code that's available here. The report is completely correct and could result in a timer being scheduled out of sequence if it's scheduled around the point when GetTickCount() wraps. I've coded up a fix but I need to write it up and post it. It may take me a while to do this as I have a lot going on in my life at present, if you need the fix sooner then drop me a mail. Updated: 4th April - Fixed code now available here.…

.Net Abstract base classes vs. interfaces

| 0 Comments
An interesting piece here from Phil Haack about why they decided to use an abstract base class rather than an interface. Versioning is always a complicated thing for library designers. I know that I'm lucky in that I don't have a gazillion users of my libraries so I tend to make breaking changes rather than build up technical debt in the name of backwards compatibility but I've worked on software where we couldn't do that and where binary compatibility was important. The fact that you can work around part of the .Net type versioning system by using abstract base classes…
For some time I've had a class which implements asynchronous file writing. It's the basis for a logging class that some of my clients use. The class builds on several of the classes in The Server Framework and uses I/O Completion Ports and a thread pool to manage the overlapped I/O. Due to the way that I structure my servers you can often share the I/O pool that you use for your overlapped log writes with the pool that deals with the socket I/O. Due to the way that thread exits cancelled pending overlapped I/O in versions of Windows prior to Vista…

Major Vista Overlapped I/O change

| 4 Comments
I'm still reading the Richter book, highly recommended even if you've read one of the earlier versions. In fact it's possibly MORE highly recommended IF you've read one of the earlier versions... It seems that lots of things have changed a little, and some things have changed a lot. Unfortunately the book doesn't detail the actual changes. Note to publishers; I'd PAY for a slim book that DOES detail the changes between the APIs that are being discussed... Take this throwaway line in the Cancelling Queued Device I/O Requests section of the Asynchronous Device I/O chapter of the latest book:…

Process management using Jobs on Windows

| 0 Comments
One of the problems I currently have with CruiseControl.Net is that some of my tests spawn multiple processes; such as server tests which run the development environment, which runs a batch file to start a server (or two) and then run a test harness which generates network traffic and then run a program to ask the server to shutdown cleanly. When these tests timeout in CC.Net they're forcibly killed. Unfortunately due to how Windows processes work, killing the parent of a tree of processes doesn't kill the children. This is because Windows processes don't know who their children are and…

Living with continuous integration

| 1 Comment
Well, it's about a month since I started running Cruise Control .Net and things have settled down somewhat now and I can almost go a day or two without tweaking my configuration or being tempted to fix issues in Cruise Control itself. For those of you that haven't been following along: First I realised that the latest (1.3) release of Cruise Control .Net wouldn't work for me without some hacking. Then I found that my idea of 'integration' wasn't quite the same as the simplistic situation for which Cruise Control .Net worked best; I have lots of projects and running…

Coding the markets

| 1 Comment
Barry (who seems to have stopped blogging) recommended this blog to me; Coding The Markets. It's pretty good if you're into investment banking development stuff.…

DNSBL - again...

| 1 Comment
If Richard Wolff is reading this then I can't reply to your emails as your ISP is bouncing my emails with this: Hi. This is the qmail-send program at ns.mgf4.net. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. Connected to 207.115.36.23 but sender was rejected. Remote host said: 553 5.3.0 nlpi100,DNSBL:To request removal of, 69.0.209.156, send the complete error message in an E-mail to removeme@sbc.sbcglobal.net I've sent a removal request message but the automated response doesn't give me that much faith that…

CruiseControl.Net patches

| 6 Comments
Hacking CruiseControl.Net to work better for my specific circumstances (lots of projects that depend on lots of projects) has resulted in the following patches to revision 3607 of ccnet which I'm just about to submit to the developers. These patches are 'supporting patches' to the main ProjectTrigger and integrator changes, I thought I'd start with the simple ones... None of these patches should change existing functionality, all require new, optional, properties to be specified to activate the new code. All patches include updated and or new tests. 1) IntervalTrigger - Added initialIntervalSeconds. initialIntervalSeconds is a new property that controls when…

How important is VC6 to you now?

| 0 Comments
I'm working on the next releases of The Server Framework, and I now have continuous integration (of a sort) so my build and test problems are being minimised... BUT... Keeping Visual Studio 6 support in the framework is becoming a bit of a mission. It's mostly simple template stuff that fails but I find that I keep having to work around VC6 issues. I'm proposing to drop VC6 support from version 5.3 of The Server Framework. The next release, 5.2.1 (which adds VS2008 support) will be the last version with VC6 support included as standard. How much of an issue would that be for…
I am intending to check out some of the other build servers that people have been suggesting, but today I was too busy with real work so I just left a cut down version of my latest CruiseControl.Net configuration running on one of my boxes and fixed a few issues whilst doing proper work most of the time... This evening I decided to go and look at why CruiseControl.Net scales so poorly and the first issue that I came across is the title of this blog posting... In the ProjectIntegrator class there's a Run() method (because, of course, all projects…

More Cruise Control .Net woes

| 4 Comments
I've almost got something that works out of CruiseControl.Net. Once I'd hacked in some fixes for the project triggers and other stuff that didn't work the way I wanted it to I concentrated on generating the config files that I required and testing the system. The good news is that I now have an integration system that works, it can build, test and deploy libraries in such a way that dependent libraries and applications are rebuilt as new versions of deployed artifacts become available. The config file generator can generate files for all of the build machines that I'm currently…

Fighting with CruiseControl.Net...

| 5 Comments
I've been trying to get my code to build with CruiseControl.Net this week. It's taken longer than I'd hoped, but I'm almost there. It became easier when I switched from assuming various parts of CruiseControl.Net would "work as I expected them to" to assuming that I'd have to delve into the source and change things... On the whole I'm a bit disappointed in CruiseControl.Net. I'm sure it works very nicely for simple situations, such as where you pull everything out of your repository and build it with a single project, but, when you're trying to do more complex things it…

CruiseControl.Net

| 2 Comments
I'm currently working on two new releases of The Server Framework, the first is a simple release to add support for VS2008 and the second is the next "feature" release. Due to the number of projects and example servers and supported compilers that I test with it can take some time to finalise a release; each example server has to be checked out, built in each build configuration with each supported compiler and then the tests need to be run... Last time I did this I had planned to put aside some time to sort out an automatic build to do it…
I picked up a book yesterday, Writing Secure Code for Windows Vista. Which seemed quite interesting, and was a nice slim volume that would slip into my hand luggage for my flight to Geneva on Friday night (yay first ski weekend of the season!). I've been flicking through it this evening and was interested in the "Standard Annotation Language" (SAL) for annotating unmanaged functions that muck around with memory buffers, it looked like a potentially easy adjustment to The Server Framework code which would possibly improve security and usability... Unfortunately it seems that SAL is only operational when you run with the…

Reclaiming my CPU...

| 1 Comment
I removed the last version of "Norton Anti-Virus" (and all of the other stuff that I've been upgraded into over the years) from the last of my machines yesterday. I've replaced it with AVG, currently the free version to test it out. All of the machines feel more sprightly and run faster. One of my old laptops which is now only used for fire-side web browsing is now actually usable again! For a while now I've thought that what was originally just anti-virus software had been getting more and more bloated with more and more things that didn't interest me…

Thank you Raymond

| 2 Comments
Raymond Chen has just blogged about "The importance of the FORMAT_MESSAGE_IGNORE_INSERTS flag" over on The Old New Thing. That's another annoying bug fixed ;). I've occasionally wondered why I get some less than informative error messages sometimes, I wasn't passing the flag in my GetLastErrorMessage() function and it calls itself if FormatMessage() fails and so sometimes I get an "invalid parameter" error messages when what I could get might actually be more useful to me.…

VS 2008

| 2 Comments
I'm currently rebuilding my world with Visual Studio 2008. So far things are going ok, but as I mentioned back when I was playing with Beta 2, the new C4627 warning about header files being skipped when processing precompiled headers is a bit broken... It seems that the code that works out if a header file is skipped (ie not included in the precompiled header but above the #pragma hdrstop line works on exact path matches rather than a file include graph. So, if header A includes header B and the precompiled header builds by including A but the source…

Back in time with DDE

| 2 Comments
After completing some work for client with the custom CLR hosting server I've started looking into a problem for another client, it's a bit of a transition as the problem that he's having is with a DDE connection from his server to a SCADA system that monitors the industrial plant where the server is based. DDE was the original way that Windows programs shared data between them. It's been around since 1987 and, well, that shows. The API is at once familiar (as an ancestor to COM) and quaint (which is a polite way of saying that I find some…

Thirteen Patterns of Programmer Interviews...

| 1 Comment
Sad but true... The "Typical Programmer" has a piece on Thirteen Patterns of Programmer Inverviews. I think I've probably been interviewed in all of these styles over the years and taken part in several of them from the interviewing side of things...…

See the "What About .NET?" sidebar...

| 2 Comments
Interesting... It seems that rumours of C++'s demise in the brave new world of .Net were slightly over exagerated, perhaps, maybe... From a recent issue of MSDN magazine: "There are two main reasons why this column was born. First, despite the phenomenal success of the Microsoft® .NET Framework, there are still plenty of scenarios where it makes more sense to use native C++. Adoption of .NET will continue to grow, but C++ is here to stay. Second, with the launch of a major new operating system it is unreasonable to expect that all the various application frameworks--from MFC and the…

VS2008 Beta 2 first impressions

| 0 Comments
I've just installed Visual Studio 2008 Beta 2 in a VMWare box so that I can start to test the x64 port of The Server Framework with the new compiler. I haven't bothered to look into what's new in the 2008 C++ compiler, I'm more interested in changes to the project file format (for the tools I'm building to fix this problem) and things that may prevent my code compiling or passing its tests rather than reasons to upgrade. So far I've had no problems, things build well and VS2008 performs pretty nicely in my 2gb mem, dual processor, x64 virtual machine.…

Nick Gunn is blogging again...

| 0 Comments
I used to work with Nick at CSFB and then at Barclays Capital. He's always been a good, techie, low-level COM/.Net geek and his latest writings on the Microsoft Concurrency and Coordination Runtime are interesting! If you're interested in async/multi-threaded/concurrent stuff then go take a look.…

VS2005 breakpoint annoyance

| 2 Comments
My Visual Studio 2005 C++ debugger seems to have stopped doing what VC6 used to do if you placed a breakpoint on a line that didn't result in executable code... VC6 used to warn you and then move the breakpoint to the next executable code line, VS2005 just seems to ignore the problem and disable the breakpoint when you're running and therefore just run straight past it... This is especially annoying in situations like this: myObj.DoThingWithLongArgumentList( // I usually set the breakpoint here... arg1, arg2, arg3, arg4, arg5); // You actually have to set it here... I'm starting to wonder…

Infrant Ready NAS NV+

| 10 Comments
I've been running a pair of 2TB Infrant Ready NAS NV+ RAID systems for a while now as on-site file server and off-site backup and so far I'm very pleased with them. I have one under my desk and one in my dad's office and they talk over a VPN and keep each other in sync using rsync. The one under my desk acts as a file server for my development boxes and as a music server for my Squeezebox music players. It seems a little underpowered for the Squeezeboxes, the UI on Squeezebox is annoyingly slow sometimes but I've…

Non-trivial...

| 0 Comments
Charles Miller over at 'The Fishbowl' provides a cheat sheet to decode what us programming types mean when we describe the difficulty of solving problems...…
I'm fixing up my performance monitoring code and this uses shared memory to communicate between the perfmon extension DLL and the application. Since I'm tightening up security I decided to explicitly pass in the security attributes, which has a possitive knock-on effect to several of my Win32 tools classes which now also need to deal with security properly rather than just conveniently... Of course once you're passing explicit security attributes around rather than simply passing 0 to the APIs you can get back some of the convenience of the not-needing-to-think-about-it style of security by passing in an "allow all" security…
So, back in June I discovered that my performance counter library code didn't work on my new Vista x64 development box... The problem seems to be that the code has always been doing things in an undocumented/unsupported way and it's only now that the old way doesn't actually work at all any more... I think I know what I need to do to fix the counter installation problem, use the wonderfully unixy named "lodctr" program (or the API alternative) to load the strings for the performance counters rather than simply shoving them into the registry myself... That means that the…

Pluggable log systems

| 0 Comments
In the past I've mentioned my lack of enthusiasm for the normal 'debug trace' files that some systems seem to include... I pretty much consider them a design smell... But, some of my clients seem to like them and over the years I've been asked to provide high performance logging systems so that they can spew random messages to files and still run at a reasonable speed. I've written and adjusted an asynchronous file writing log file class a couple of times now and it finally ripened to the point where it was time to harvest it. I finally decided…

STLPort 5.1.3 and multiple VC versions

| 0 Comments
I'm just about to try out the latest STLPort release and I went to apply my 'STLPort 5.0 multiple side by side dlls changes' from 2005 and noticed that the place where one of the changes needs to be made has changed. The change to Makefile.inc should still be made to STLport-5.1.3\build\lib\Makefile.inc but the change that was previously made to stl_msvc.h now has to be made to STLport-5.1.3\stlport\stl\config\_auto_link.h…

I'm with Dennis, and Ian...

| 0 Comments
Given what Jeff wrote recently and what Ian and Dennis said about it... I'm definitely on the Ian and Dennis side of the fence...…
I grabbed a couple of copies of "The NT Insider" from my 'not quite got around to reading' rack today and read them on the train on the way in to London. These are the quite short, bi-monthly, driver developer and kernel programmer magazine from OSR. It's free to subscribe and the content reminds me of the thrill that I used to get from reading computer mags back in the late 80s... I guess it's possibly the fact that lots of it is slightly alien to me, there's a certain excitement in knowing that there's so much to learn and…
I've been having some problems with Explorer hanging when opening "My Network Places" on some of my machines. Some work fine, some hang. Most annoying. I've been trying a few things over the past few weeks (as and when I get a hang and as and when I feel like it), but nothing has seemed to have fixed anything, until this morning... I've recently adjusted my networking kit and now have a couple of UPnP devices floating around and it's useful (but not essential) to be able to connect to them directly in Explorer. One of my machines didn't have…

Taking more of my own advice...

| 0 Comments
I'm continuing to work through my list of things to do for The Server Framework (and all the libraries that support it) and I've recently got to the 'set up Doxygen and do a bit of documentation' item...…

Yay .Net sockets stuff...

| 0 Comments
Nice to see that the new beta, sorry, CTP, of the next .Net Framework will increase the performance of .Net sockets by 70%! Way to go .Net dudes.... Interesting to see that it's a joint effort between the System.Net people (who, I assume own the sockets code) and the CLR people (who own the platform)... I wonder what the CLR guys brought to the tuning table... It would be nice to know how the new (and existing) .Net sockets performance compares with the Win32 equivalent...…

Hmm, is this really a good fix?

| 0 Comments
Back in July Joe Duffy wrote an interesting piece on the CLR thread pool. I commented on it then, here. He's now written another piece about why they increased the maximum number of threads in "the thread pool" from 25/cpu to 250/cpu. Joe, I refer you to my previous comment... You're solving the wrong problem!…

Software failures...

| 0 Comments
I'm in Jackson Hole right now, my skis are still in Denver... Although they've replaced the baggage handling system at Denver International Airport since the days of the classic software project failure, it seems that the current system could still need some work ;) Hopefull I'll see my skis later today...…

Dino Viehland on CLR hosting

| 0 Comments
This is mainly a reminder for me so that I can read this when I get back from Jackson Hole... Dino Viehland has written some interesting looking blog posts on how to implement the thread/task and syncrhonisation host managers for a hosted CLR. Note that this is all "Whidbey beta 1" stuff so, well, your milage may vary...…

Crapness in mscoree.h

| 0 Comments
I'm playing around with hosting the CLR in C++ at present and have come across a bit of crapness in the mscoree.h file... #if (_MSC_VER < 1300 || _WIN32_WINNT < 0x0500) typedef VOID ( __stdcall *WAITORTIMERCALLBACK )( PVOID __MIDL_0011, BOOL __MIDL_0012); #endif // (_MSC_VER < 1300 || _WIN32_WINNT < 0x0500)…

Some interesting stuff from Katie Lucas

| 0 Comments
Here are a few interesting views on software development from Katie Lucas. Via Joel on Software. I especially enjoyed the design methodologies, becoming a manager and "remove developers net access" pieces.…

Why do developers still use VC6?

| 2 Comments
Tim Anderson asks why there are so many developers still using VC6... Well, as I said before, if you produce C++ software in source code form and any of your clients require that you support VC6 then it's often easier to maintain the project files in VC6 (and thus use that as your day to day development tool) than it is to use any of the newer compilers. The reason for this is that all of the newer releases will read and convert VC6 project files but none of them will write out project files that work with earlier releases.…

Nerd in a cave

| 0 Comments
This is something that anyone living with a geek really needs to understand. I find it interesting that Rands has his set patterns of behaviour for getting into The Zone in the mornings. I'm very much a creature of habit and I actively "grow" new and effective patterns of behaviour as and when I recognise them... I hadn't really connected the successful completion of the patterns as being an enabling device for getting me into The Zone... Must look into that a little more when I get back. I also like the explanation of The Zone and The Place... Worth…
It seems that Vista contains lots of interesting new Win32 API calls and some of these provide built in support for deadlock detection... I guess my deadlock detection tool can operate differently on Vista then...…

CLR thread pool woes

| 0 Comments
Joe Duffy has written an interesting piece over on "Generalities & Details: Adventures in the High-tech Underbelly" about problems with the CLR thread pool. Joe's a program manager on the CLR team at Microsoft, so he knows what he's talking about! I find the issues that Joe raises interesting as I spent some time designing a flexible thread pool for my C++ IOCP servers some time go and came across the problems that he's facing. In essence the problem is that you want to allow the thread pool to grow and shrink based on demand but you don't want it…

IDisagree

| 2 Comments | 1 TrackBack
Jeremy D. Miller talks about how he dislikes the "I" prefix on interface names and how he'd prefer to ditch it in the same way he's ditched most other hungarian notation. I'm all for ditching hungarian but I actually quite like the "I" prefix; though I no longer read it as "this is an interface" but simply "this is what I do". In other words my interfaces, called things like IManageUsers simply clearly state what they do, classes that implement the interface manage users; the class definition is saying "I Manage Users"! To this end I usually find that my…
Typical. My usual subject matter isn't interesting enough to get onto digg.com, etc. but a throw-away post about using Ethereal to catch my partner cheating gets on the front page... Ah well, such is life :) I'll just try and write more interesting technical postings and in the mean time appreciate the kind words, the linky goodness, the traffic spike and correspondingly increased adsense revenue...…

VS2005 STL strstream and stringstream leaks

| 2 Comments
Well, it turns out that my initial gut instinct about the leaks that I found in my socket servers when built with VS 2005 was correct. It was an STL thing.…

New kind of spam?

| 0 Comments
Recently I've been getting lots of emails from people who seem to think that my company, JetByte Limited, is currently recruiting. We're not now and are unlikely to be in the near future, but that doesn't mean people shouldn't send speculative emails. In the past I've always responded to each of the applicants, explained that we're not recruiting, and sometimes even made suggestions on how they might improve their approach and/or resume/cv. Recently I've had to stop doing this as I've been getting more and more unsolicited resumes for more and more wacky and way out positions that do not…

Good stuff

| 0 Comments
Once again I have a list of items flagged for comment in Bloglines but at least this time I have an excuse: "We were on a break!". First is a link from Brad Wilson to where Bruce Eckel writes about how the "Hyper enthusiasts" of the Java world have moved on to Ruby. Bruce makes some good points. Personally I'd be pretty happy if all persuasuion of "hyper enthusiast" were to vanish overnight, IMHO they just get in the way, distort the picture and encourage bad decisions...…

Sounds like a real nice way to work

| 0 Comments
Noel Llopis, over at Games From Within, has written a nice piece about a typical workday at his work place, High Moon Studios. It certainly sounds like a nice way of working. Unfortunately I haven't been involved in quite that agile a team yet.…

More on the socket server leaks

| 7 Comments
It seems that the leak that I found isn't likely to be the one that my new user of the code is having problems with. They've built the code with Visual Studio 2005, made a few (correct) changes to the code to get it to build with the stricter compiler and they find that several of the servers leak; at first it looked like it was just the more complex servers but I've just tested the simplest echo server and that leaks in just the same way. They're obvious (big) leaks. Unfortunately, though the leak itself is obvious, the cause…

Leak plugged

| 2 Comments
Well, the leak in my legacy code wasn't too hard to find. There was one potential leak and one screamingly obvious leak. I'll post the fixed code tomorrow.…

Always Produce

| 3 Comments
Paul Graham writes about "How to do what you love"... It's quite a good piece but the best bit is hidden down near the end. He suggests that a good way to "stay honest with yourself" about dreams to do something other than your "day job" is to Always Produce; that is, don't just talk about it or think about it, produce physical artefacts. This is excellent advice and it can be applied to pretty much everything you do.…

The best toys always come with an SDK, 2

| 0 Comments
I finally got around to upgrading my mobile phone from an aging Sony Ericsson T68i to a more current (though still hardly bleeding edge) Motorola Razr V3. I'm not interested in the downloadable java games but the fact that you can get a J2ME SDK for it and that the docs seem to imply that you can access the GPRS network using SSL and that you can also access the serial port makes it interesting... Now I just need a hack to be able to somehow connect the Garmin GPS to the V3 and some code to grab the location…

First tracks

| 0 Comments
Last week I managed to get my GPS code to download the GPS "track" from my device and create an html file that uses the Google Maps API to display it as an overlay. I spent some time trying to get the map to display correctly from within the normal blog pages but something was causing Internet Explorer to fail to display the tracks. Firefox and Opera were fine; I guess it's something to do with IE using VRML to display the track and the others using a server-side generated graphical overlay. Anyway, the file is here.…

Purecall

| 2 Comments
I've been plugging away at my multi-process Win32 debugger code this week and one of my test harnesses had started to suffer from intermittent "R6025 - pure virtual function call" errors. These tend to crop up if you call a virtual function from a constructor or destructor or if there's a race condition between calling a method on an object from one thread and destroying the object in another thread. For me, at least, they tend to be simple mistakes to fix once I know where the problem lies. Unfortunately, often the standard error report of a "purecall" is less…

A collection of links

| 0 Comments
Once again I've been too busy to comment on the following blog postings in a timely manner so here's a collection of stuff that's been sitting in my "good stuff" list for a while now.…

So that's what it's called

| 0 Comments
Jeremy D. Miller points out that my 'second' style of coding (see here) is called writing a "spike" in XP terms.…
If you're into writing C/C++ XLL addins for Excel and you'd like to help make sure that the new features in the new XLL interface provide all the functionality that you'd like, then it might be an idea for you to get in touch with David Gainer via the contact form on his Excel 12 blog.…

Excel addins sharing data

| 0 Comments
Or, marvelling at my own, past, cleverness. I've been doing a lot of work on these Excel addins for my current client and, as I get back into the whole C++ XLL stuff, I start to realise just how cool my child of 2001 really is.…

Beware the momentum of prototype code

| 4 Comments
A while back Chris Baus wrote a little rant about prototypes. I started to write a piece that defended prototypes when correctly used and ran out of steam; or, more to the point, couldn't really say very much except they're OK except when they're not, try not to get to the point where they're not. Having just recently been bitten by a prototype that was trying to rise above its station, I now have more to say.…

Detecting the Excel Function Wizard

| 0 Comments
I'm currently working on some C++ Excel addins for an investment bank. I originally wrote the addins for them back in 2001 and they've evolved slowly ever since. Right now we're adding some new functionality and, whilst testing some of the new functions in the test sheets, I noticed that the functions weren't behaving themselves properly when the Excel Function Wizard was in use...…

Now I'm confused (C++/CLI destructors)

| 2 Comments
So here I am, writing a piece about how the C++/CLI destructor and finalizer stuff could have been a bit neater and I put together some sample code to demonstrate my point and it doesn't do what the docs I mentioned yesterday suggest that it should do...…
Beware! The rules for when a destructor is called for a managed C++ class in Visual C++ are different than for "normal" C++ class.…

Grumpy old men

| 0 Comments
Am I a curmudgeon of technology? You betcha - Ted Neward over at "The Blog Ride" explains why he's cynical about new technology and suggests that we'd do well to have a little more cynicism. I agree with him, I tend to take a similar position having been let down by various "silver bullets" in the past. I think I decided that it was my time spent working with OLE DB providers that caused me to be more cynical towards the Microsoft technology hype machine; When someone brings me a "cool" new technology and claims that because simple things are…

iTech Bluetooth Virtual Keyboard

| 2 Comments
I recently purchased an iTech Bluetooth Virtual Keyboard for use with Michelle's PDA. It's basically a little box that's about the size of two packets of chewing gum with a red window in the top. It projects a keyboard onto a flat surface and detects when you press the keys. It's one of those devices that looks too cool to work, but it does, kinda... Unfortunately there were driver problems with the iPaq 4150 that meant that it would work for around 20 keypresses and then stop, reset itself, reconnect and then start working again... At first I thought that…

LEGO Mindstorms NXT

| 0 Comments
LEGO has announced a new version of their Mindstorms autonomous robot building system. I did a fair amount of playing around with the original Mindstorms kit way back when and created a system that allowed you to control your robots over a NetMeeting connection. The new Mindstorms NXT system sounds pretty cool. I like the idea of being able to use bluetooth to control and download programs to the robots and the new sensors sound much more complex than the old stuff. Via GoRobotics.net.…

Programming by contract in C++

| 0 Comments
There's the first part of what I expect to be a very nice article about programming by contract in C++ over at The C++ Source: The Nuclear Reactor and the Deep Space Probe. Updated 3rd Jan 2006 - the article now appears to be called Contract Programming 101.…

Garmin eTrex Vista C communications protocols

| 2 Comments
As I mentioned a while back, I got a Garmin eTrex Vista C handheld GPS as a Christmas present and there's code available from the Garmin website that lets you talk to it via its USB interface. There's also a specification document for the protocols that it uses. At first glance this is great. I've seen better specifications but with a little trial and error I've managed to transfer the saved GPS tracks from the device to my code and I can set the device up to send it GPS position every couple of seconds (so I could use it…

Thought for the day

| 0 Comments
Does anyone in IT use paper clips for anything other than resetting hardware either by pressing those hard to reach reset buttons or by shorting out bios batteries, etc?…
I got a Garmin eTrex Vista C handheld GPS as a Christmas present. Another cool tool to add to my geeky ski stuff. So far I've only used it to navigate to and from a restaurant yesterday lunch time, but it seems to have lots of features that will make it useful on the mountain. The best thing about it? There's an SDK that you can download to communicate with the device. The SDK is more of a spec and a bit of sample code that shows you how to get a handle on the USB device driver but that's…
There's an interesting article by Tomer Abramson in this month's Dr Dobb's Journal about deadlock detection. He provides a compile in tool that works in a similar way to my deadlock detection tool and reports on potential deadlocks in code even if they never occur during the program run in question. His architecture is considerably different to mine but the idea is the same. By recording the sequence of lock acquisition and release on all threads in the program you can then examine the sequence that locks are taken out and spot potential deadlocks.…

More thoughts on thread naming

| 5 Comments
I've just finished the first cut of the code that handles the Win32 Thread Naming "API". This means that my debugging tools can now report the name of a thread (if it has been named) rather than just its thread ID. Having implemented the code in the debugger to deal with the exception I find myself wondering about API design and why the original designer of this particular facility decided to make it hard on themselves.…

On Edit and Continue

| 6 Comments
Dennis Forbes talks about "Edit and Continue" in VS 2005 and asks "Is it, coupled with similar tool advances, making programmers sloppier, though?" I think so...…

Pluggable exception handling

| 0 Comments
Ben takes the "throw as an exception dispatcher" idiom to its logical conclusion by presenting a pluggable exception handler. As Ben says "I'm not sure how many situations something like this would be useful in, but it fit the testing problem well and was fun to write anyway". It's not the kind of code you need every day, but it's useful stuff if you're working on a test framework, or if you're interested in how you can use the "throw as an exception dispatcher" idiom.…

STLPort 5.0 and multiple VC versions

| 2 Comments
I'm in the process of testing some of my code with Visual Stuio 2005 and the first thing I found that I needed to do was to upgrade my STLPort installation from 4.6.2 to 5.0.0 to get a version that built with VC8. Given that I like to test one change at a time I first upgraded my VC6 build to use STLPort 5; STLPort built fine with VC6 and all my tests passed. The next step was to build STLPort with VC8, build my code with VC8 and run the tests. Unfortunately this is where the latest version of…

Naming Win32 threads - how it works

| 0 Comments
I've been using the SetThreadName() function from the MSDN docs for ages to provide a way of distinguishing between threads in the VC debugger. I always thought it was a bit of a weird 'API' but had never really thought to wonder why. Steve over at "Bug Babble" explains how the 'API' works from the debugger's point of view and, well, then it all becomes obvious. For some reason I'd always thought that the 'API' was communicating with the OS in some weird and wacky manner; I hadn't twigged that in fact it was just communicating with the debugger using…
Ned Batchelder reminds us of the value of the C++ FAQ (Lite). It's been a long while since I've looked at it yet Ned's example shows that I've still a lot to learn about the subtleties of C++. I can think of a few places where I could use that throw; as an exception dispatcher example to replace some rather ugly macros.…

A change of technologies

| 0 Comments
I started back with an investment banking client this week. I'm working with the team that brought us "the refactoring project" and another small team, and integrating the trade entry system with some "xll" excel addins and some back end server software. Pretty standard fare for investment banking work... I've worked with this client quite a few times over the years and it's interesting to go back and find that they're still using the systems that I helped them to put in place back in 2001. It's nice to see all of the C++ Excel addin code still in regular…

Udi Dahan on Physical Design

| 2 Comments
Udi Dahan writes about managing dependencies in code at the 'package' level in "So many Dlls, so little time". "Sloppiness with dependencies. If two classes are independent of each other, and do not provide different implementations of the same interface, think twice about putting them in the same project/dll. Minimizing dependencies is the bread and butter of loose coupling. Break dependence on implementations by introducing interfaces in a separate project/dll."…

Hosting problems resolved

| 0 Comments
It looks like all of the hosting problems are now resolved. There was a brief period when the database and CGI were fixed and an MT configuration path hadn't been updated so pages were not being rebuilt after comments were added but that's now been fixed and the pages have been rebuilt to include the missing comments. If anyone notices anything strange please leave a comment on this posting.…

I don't like Vanilla Scoble

| 0 Comments
Robert Scoble, the "Microsoft Geek blogger", has recently had a complaint that he only writes about Microsoft and he figured that he was in a rut and decided to get out of his rut by deliberately not writing about his usual topics of Microsoft, Google and Yahoo (GYM) for 100 posts... So, for the last 3 days he's been writing about other stuff... There are problems with this idea though...…

Why are the "event" classes in .Net STILL broken?

| 0 Comments
Whilst I'm ranting about the little things... You still can't create named versions of the .Net ManualResetEvent and AutoResetEvent, even in .Net 2.0. Wasn't everything going to be fixed in Whidbey?…
Every now and then I come across a situation where encapsulation has been taken slightly too far. Usually, or at least most recently, these over encapsulated designs have had problems because they've blocked access to an event handle. It's great to wrap up a bunch of Win32 primitives into a nice coherent class but if you expose a method that allows the user of the class to wait for something to happen then it's probably also a good idea to expose a handle they can wait on as well. Failure to do so imposes unnecessary restrictions on how the user…

Bad Managers?

| 5 Comments
Alan Green doesn't like the word "manager" used as a class name suffix. His point seems to be that "manager" is imprecise and instead he suggests a list of alternative suffixes with more precise meaning; though they seem to be rather contrived and smack of using new words just for the sake of it to me. For example using "Herder" rather than the more usual "Collection" (PolicyHerder, hmm...) and using "Bucket" as a pretty non standard replacement for "Pool". He also suggests using Supervisor which seems, to me at least, to be potentially as vague as Manager and just, well,…
Jochen Kalmbach has discovered a problem with dynamically linked applications built with VC2005 running (or not running!) on NT 4. I guess this isn't going to bite that many people... Read about it here.…

Note to self

| 4 Comments
This CodeProject entry is SO full of errors and poor practice that I must find the time to leave a comment on it... [Updated: 29th October] Done. Comment is here.…

Evil macros in April 2005 Platform SDK headers

| 2 Comments
I'm upgrading one of my build machines to use the April 2005 edition of the Platform SDK to investigate the implications of this posting over at eggheadcafe.com which states that since Visual Studio 6 ceased to be supported as of the end of September 2005 the last version of the Platform SDK that will work with Visual Studio 6 was the February 2003 version. There has been quite a lot of discussion in the comments of my Bluetooth code sample about the 'broken' uuid.lib file in the later Platform SDKs. I thought it was just a corrupted lib file but…

If you enjoyed the Petzold thing earlier...

| 0 Comments
This may also be your kinda thing. Ellen Ullman's 1998 two part series "The Dumbing-Down of Programming" from Salon archives. Rebelling against Microsoft, "My Computer" and easy-to-use Wizards, an engineer rediscovers the joys of difficult computing. Returning to the Source. Once knowledge disappears into code, how do we retrieve it? Via Joey deVilla over at The Farm. I'd forgotten how readable Ellen Ullman was (especially for techies of "a certain age"). I read a novel of her's, Close To The Machine, this time last year. Worth checking out, as is this interview with her, also in Salon. This week is…

LNK2005: _iswdigit already defined in ...

| 1 Comment
I'm in the process of preparing a release for a client. I've done the work, the tests pass, the stress test runs with flying colours and so I've tagged the source and I'm in the middle of the final build and test cycle. It's a nice feeling. One of the last things I do when shipping code is to turn off the default STLPort support that I use when I'm developing. I edit one header file and the whole codebase switches from using STLPort to using the STL that ships with whatever version of VC you happen to be using.…

Charles Petzold on coding

| 3 Comments
Charles Petzold recently delivered a talk at the NYC .Net Developer's Group and he's made it available online here "Does Visual Studio Rot The Mind?". It's an interesting read, especially if you actually remember writing early Windows GUI applications and building your dialogs in your resource files by hand. I agree with his view that many of the features of Visual Studio are there simply to help us write code faster and that this doesn't, necessarily, result in us writing code better or in code that is clear of fluff and easy to maintain. I commented recently (on a post…
It seems to be stack walking week; what with Ned's posting earlier about walking an unmanaged stack and now this excellent piece by David Broman on doing the same in with managed code.…
The discussion on Assert goes on, this time in Japanese... Google's language tools lead me to believe that they're disagreeing with me. They seem to be pretty shocked that I'd take this stance and appear happier when Noel puts me in my place and returns order to the world. ;) If anyone can come up with a better translation, leave it as a comment please.…

Throwing the baby out with the bathwater

| 7 Comments
Richard Hale Shaw writes on using statements in C# and his conclusion is "it's too confusing" and "I'd suggest not even using using statements". I think that position is a little harsh, but I think that the main problem is that using tries to provide support for "scoped locals" and it doesn't do it well enough.…

More on locking

| 0 Comments
Jeff Darcy over at "Canned Platypus" writes about "How to add locking to a program". He laments the lack of a reasonably priced deadlock detection tool. I assume, from his backgrond, that he's interested in an Linux tool, so my deadlock detection tool wont help him much but it's good to know that it's not just me that thinks such a tool would be useful... Jeff links to some expensive static code analysis tools that do deadlock detection. My tool doesn't rely on static code analysis, so you don't need to have source to run it. It can tell you…

Walking the call stack

| 0 Comments
Ned Batchelder has written about the code he uses to get a call stack out of a windows program (thanks for the link Barry). I've added a snippet of the code I use as a comment to his post. Note: the deadlock detector mentioned in this blog post is now available for download from www.lockexplorer.com. I started looking into working with windows call stacks a while ago when I was working on my deadlock detection tool. What surprised me was how easy it was to get a call stack once you understood the DebugHelp API. There are lots of examples…

MT-Blacklist

| 3 Comments
It seems that Jay Allen has shutdown both MT-Blacklist and the 'master blacklist' due to bandwidth problems caused by either a denial of service attack or inconsiderate developers. Jay hosted a regularly updated file of regular expressions that powered the MT-Blacklist comment spam blocking add-in for Movable Type 2.x. He also published a changes feed that made it easy for others to update their own black lists using the master feed. Unfortunately some developers ignored the feed and simply pulled the whole file all the time and just recently this issue has escalated and led to severe bandwidth usage and…

Jeff Darcy on Linus on specifications

| 2 Comments
Jeff Darcy over at "Canned Platypus" has written a nice piece on specifications and how Linus has got it wrong. Any post that contains the phrase: "... who wouldn't know good code if it got into a robot and literally bit them ..." has to be worth a read, and as Jeff says, there's a vast difference between a truly good specification and a bad one. Good specs are worth their weight in gold and can be a joy to work from. I'm just about to resume a project for a client who produces very good specifications and the certainty…
Noel Llopis over on "Games from Within" has written a nice rebuttal to my Asserts are evil post and the follow up. I think it's probably about time to wrap this up ;) So, here's what I've learned... [Updated: 24th October - there is an interesting discussion still going on over in the comments on Noel's post...]…
A collection of blog posts that I flagged for follow up this week.…

Is Raymond Chen's use of Assert valid?

| 16 Comments | 1 TrackBack
I'm sure you're all getting bored on my views on using Assert in modern C++ code by now, I'll try and make this the last one. Last time, I asked if anyone had what they'd consider to be an example of the use of assert in C++ where the usage was valid given my objections to assert. Mark updated this recent posting on the subject to include a link to Raymond Chen's blog where Raymond is discussing COM object destruction and uses an assert... Given that everyone knows that Raymond is a seriously good programmer doesn't his use of assert…

More from Mark and Barry on Assert

| 9 Comments
Mark responded to Barry's response to my post on Assert. Barry then responded to Mark and Kim and I added a little more in the comments. I did have some more to say, but Barry's said most of it... Anyway, so far only Vagn Johansen and the guru's over on comp.lang.c++.moderated disagree with us... Anyone else fancy joining in? What I'd like to see is for someone who's defending to show a situation where the alternatives that we're proposing don't work; but lets try and stay out of the realms of "what if the compiler is broken" and "what if…

Common knowledge to many, but...

| 0 Comments
Alexis Smirnov has just written a piece on why you shouldn't try and use STL's map::operator[] to find out if a map contains a particular element. It's probably common knowledge for most people using STL, but it's worth repeating for those new to the std::map interface.…

Barry's take on Assert

| 2 Comments
Barry Lapthorn has a response to my Assert is Evil posting where he concludes that assertions aren't needed if you have tests... He also raises a point that I missed which is that the typical assert on Windows machines causes a dialog box to pop up and stop your program giving you the option of debugging it or ignoring the assert, etc. This kind of response is not especially useful if you're writing code that doesn't interact with a user, such as a service, as the code may not be able to show a dialog box ...…

Good stuff

| 4 Comments
I use BlogLines to read my RSS subscriptions. It's pretty good, and now that the performance issues I had initially seem to have gone away, I like it a lot. It's very handy to be able to read my feeds from anywhere and always have them up to date and synchronised. One of the features I like is the little "keep new" check box that each item has; check it and the item stays unread. I use this to keep the interesting stuff on top so that I can write about it later. This week I've been busy with my…

Opera lover

| 1 Comment
The Opera web browser is now free. It's worth giving it a try. I downloaded it after Barry sent me a link to the free registration codes that they were giving away a few weeks ago to celebrate their 10th birthday and I've been using it as my browser of choice ever since. It seems faster than either IE or Firefox and I just feel more comfortable in it than in Firefox; no idea why. I like the tabbed interface, I like the fact that it can remember my last session and I know you can do all of this…

AdSense preview tool

| 0 Comments
The Google AdSense Preview Tool does exactly what it says on the tin. So it's very useful for working out what kind of ads you'd get if you added Google's AdSense to your pages.…

New C# v3 features explained in context

| 1 Comment
Ted Neward has a very nice piece about the new language features in C# v3 and how they work together to provide something quite powerful. Go read it! Given that implicit typing, object initialisers and extension methods are all designed to allow LINQ to be a be able to generate classes on the fly and extend existing classes I'd still be happier if they could be optionally restricted from use on 'normal' classes to help prevent the less experienced running amok with these new language features and creating code that has interesting maintenance properties...…

Restricting the use of extension methods?

| 2 Comments
Having looked through the slides that Vagn pointed me to in a comment to my recent post about C# v3.0 Extension Methods I can understand, a little more, about the reasoning behind the change to the language. Given that the C# v3.0 spec contains the following warning: "Extension methods are less discoverable and more limited in functionality than instance methods. For those reasons, it is recommended that extension methods be used sparingly and only in situations where instance methods are not feasible or possible. Extension members of other kinds, such as properties, events, and operators, are being considered but are…

Concepts and C++ Templates

| 0 Comments
The slides from Herb Sutter's C++ Futures talk (TLN309) at this year's PDC refer to "Concepts" in C++ templates; for me this is a much more useful addition than the auto keyword repurposing. I'm sure this is something that would make Chris Baus happy...…

Whilst I'm on the subject of code communication

| 0 Comments
I've never really got to grips with the STL's algorithms; actually that's not strictly true, it's really just for_each() that I have most problem with. To me, code that uses for_each() simply doesn't communicate as clearly as code that uses an old fashioned loop.…

Sacrificing precision for ease of use?

| 6 Comments
I'm probably jumping the gun a little here as I can't find Herb Sutter's slides that Matt Pietrek is referring to, but... Once again I find myself asking why is it actually useful to repurpose the auto keyword in C++... The idea seems to be that rather than this: foo::iterator i = myList.begin(); You can do this: // Type of 'i is inferred from the assignment auto i = myList.begin();…
There's a lot of noise coming out of the Microsoft PDC right now. Something that interested me was the future direction of C#; you can grab the spec from here. It seems they're adding "extension methods" which, to me, appear to be just syntactic sugar to make up for the lack of free functions...…

Overriding virtual functions, C# is better than C++

| 2 Comments
I've been merging my UDP framework development branch back to main, building all of my example servers and running all of the "black box" server tests for The Server Framework. In doing so I've experienced the pain of changing virtual function signatures. This is one area where C# syntax is definitely better than the C++ syntax...…
Google have a beta of blog search engine up and running here. It looks good, seems to work and does pretty much what you'd expect. I'm left wondering why it's needed though... After all, how to you define a blog? How is a blog different to a product company's web site that happens to publish news and information via an RSS feed? Now that Google has categorised part of the search space as "blogs" I wonder if they intend to move these sites off of the main Google search; much in the same way that Google Groups separates news group…

Assert is evil

| 13 Comments | 1 TrackBack
Christopher Baus has been away and whilst he was a away his HTTP proxy shutdown due to a bug which caused an assert and his site was unavailable. Personally I abhor assert; but I completely agree with what Chris is talking about.…

More thoughts on change and typedefs

| 0 Comments
Of course, now that I'm well into using the "option 4" I start to remember why I kept sliding back from options 2 and 3 towards 1. Although option 1 uses native types instead of typedefs which is bad for all the reasons I listed in the previous post, the other options only give the illusion of type safety because they use typedefs...…

Pimp my hide

| 0 Comments
As some of you may have guessed, the fact that I've spent the last week working on a tool for my own use means that I'm a little light on client work right now. If anyone needs a Windows C++ guy drop me a line. There's plenty of samples of my work on this site and more on CodeProject. I'm more than happy to quote you a fixed price for stuff if you know what you want. I'd prefer to be writing new code for you, ideally internet server style stuff, but I can turn my hand to most things…

In summary, don't summarise too soon

| 0 Comments
I've been working on my deadlock detection and lock monitoring tool quite a lot this week; that and fixing the issues that it's been highlighting. Yesterday I decided that I was drowning in data and that I really needed a GUI and, as I thought about how the GUI should work, I realised that I really didn't have enough data. Note: the deadlock detector mentioned in this blog post is now available for download from www.lockexplorer.com.…

Change is good

| 0 Comments
I like to experiment with new coding practices. Not too many at once mind you. I tend to add one new thing to how I work, operate in the new way for a while and then decide if the new way is worth adopting as a habit going forward. By adding new practices every so often I push my work habits in new directions; some of it is good, some is not so good, but all of it is an opportunity to learn. Sometimes during these experiments I try and go back to first principles; everyone says goto is bad,…

Lots of answers but little help

| 2 Comments
I don't read many newsgroups, I don't have the time, but I take notice of the Windows networking ones as they're low traffic and they're relevant to a lot of the work I'm doing at present... I've noticed something that's starting to bug me a bit and I'm not sure if it's specific to Microsoft related technology newsgroups but I have a feeling that it might be... Anyway, the thing that bugs me is that there are some very active people who feel that they have to answer almost all new messages yet actually add very little value.…

What's with CreateProcess and managed exes?

| 1 Comment
I have some code that launches another process in a suspended state, does some stuff (tm) and then resumes the process. This uses CreateProcess() and works fine on unmanaged exes. When I try and launch a manged exe with the same code the process starts up in a running state rather than in a suspended state. The docs for CreateProcess() don't mention any strangeness. Does anyone know of any docs that explain what's going on?…

Viewing lock lifetimes

| 0 Comments
I added some more monitoring to the deadlock tool. You can now view the entire life cycle of the locks, from initialisation, through usage to destruction. The lock usage figures put the contention figures in context as you can see how often the lock was acquired by each thread and compare that to how often there was contention... Note: the deadlock detector mentioned in this blog post is now available for download from www.lockexplorer.com.…

Observing lock contention

| 0 Comments
The deadlock detection tool that I was working on last week is coming on nicely. I managed to locate two potential deadlocks that had never caused any problems in code that is running live on a client's site. Once I had a report from my tool it was relatively easy to fix the problems. Both of these were real bugs that just hadn't bitten yet. Today I added some rudimentary lock contention monitoring to the tool and the results seem to be quite useful... Note: the deadlock detector mentioned in this blog post is now available for download from www.lockexplorer.com.…

I've been lazy this week

| 4 Comments
As I mentioned in an earlier posting I've been working on a tool this week. I'm too lazy to do a job manually and so I decided to write a tool to help me do it... Note: the deadlock detector mentioned in this blog post is now available for download from www.lockexplorer.com. The tool is designed to help me track down deadlocks in code. I decided I needed this tool because I wrote a piece about debugging deadlocks in Visual C++ and realised that using trial and error to locate deadlocks in some client code simply wasn't good enough. The…

Make sure you are doing RAII properly

| 0 Comments
There's an interesting post over on the Joel On Software forums about RAII in C++. The original poster's problem is clearly stated in the first line of their question: When the constructor for CTheClass runs, I want to acquire 3 resources. These 3 resources will be freed in the destructor (that's RAII, right?) Wrong.…

Reader Questions

| 0 Comments
Ahsan Askari asked the following in a comment to one of yesterday's posts: Just like to know whether you use external libraries specially 'BOOST' in your commercial projects and related pros-n-cons ? Also i like to know your initial strategy of Software development. I mean you've written a lot about your coding and tsting techniques but i like to know how you start the project, whether you believe in UML and how you carry out analysis. Here's the answer...…
I'm still reading someone else's code and it just struck me that a lot of 'strange' coding practices become unnecessary if you factor your code 'correctly'. Note that both 'strange' and 'correctly' live in the Len::Personal::ViewOfTheWorld namespace... Take this, for example: // show line number info, NT5.0-method (SymGetLineFromAddr64()) if (this->m_sw->pSGLFA != NULL ) { // yes, we have SymGetLineFromAddr64() if (this->m_sw->pSGLFA(this->m_hProcess, s.AddrPC.Offset, &(csEntry.offsetFromLine), &Line) != FALSE) { csEntry.lineNumber = Line.LineNumber; strcpy_s(csEntry.lineFileName, Line.FileName); } else { this->OnDbgHelpErr("SymGetLineFromAddr64", GetLastError(), s.AddrPC.Offset); } } // yes, we have SymGetLineFromAddr64() The comments, which can rot, would be completely unnecessary if the whole block of code…

I just don't get it, what's with this->?

| 7 Comments
I'm looking at some code to help me understand how to use the dbghelp.dll Windows stack walking and symbol discovery stuff and the code I've found on the net uses a programming style that I've seen a few times before and have never understood the reason for. if (this->m_sw->pSGSFA(this->m_hProcess, s.AddrPC.Offset, &(csEntry.offsetFromSmybol), pSym) != FALSE) { strcpy_s(csEntry.name, pSym->Name); // UnDecorateSymbolName() this->m_sw->pUDSN( pSym->Name, csEntry.undName, STACKWALK_MAX_NAMELEN, UNDNAME_NAME_ONLY ); this->m_sw->pUDSN( pSym->Name, csEntry.undFullName, STACKWALK_MAX_NAMELEN, UNDNAME_COMPLETE ); } else { this->OnDbgHelpErr("SymGetSymFromAddr64", GetLastError(), s.AddrPC.Offset); } Why did the author feel it necessary to be explicit about his use of the current object by specifying this-> when accessing…

It's obvious when you think about it, but

| 2 Comments
Piracy is not an enemy until you are famous. Until that point, obscurity is your enemy. I think independent creators should spend all of their attention fighting obscurity until they are famous, and only then should start to worry about piracy. Derek Silvers, via microISV…

The price of freedom is eternal vigilance.

| 4 Comments
Kevin Barnes has written a nice piece on "freedom" languages, his word for Ruby, Python, Perl, etc. He compares these with "safety" languages, such as C++, C#, Java, VB, Delphi. He starts off by saying "I picked the terms freedom and safety because they represent a philosophical split that I'm not sure some of the advocates of these languages realize is present. You can sense this split when you listen to the words that the various pundits use when discussing the merits of different languages." and continues to compare and contrast the strengths and weaknesses of each kind of language.…

JLR on C++ interfaces

| 0 Comments
A while ago I came across JLR's weblog and read his three postings using interfaces in C++ (1, 2, 3). I fired off a quick comment on the first article because I didn't agree with a couple of things he was saying. Jose's response to my comment grew into this posting and, well, now I need to explain my position in more detail. This is it...…
This is a nice piece by Tim Anderson on why COM is still alive and kicking despite what all the .Net-heads would have you believe... It always seemed to be pretty obvious to me that all the "COM is dead, long live .Net" hype was just that, hype. Whilst there are obvious advantages to using .Net for new projects there are a lot of projects out there in the wild where you can't just throw away all of the investment that has been made in COM. Also, as Tim points out, .Net doesn't really have replacements for all of the…

It's the libraries, stupid

| 0 Comments
Jeff Atwood has a nice piece on the productivity of different programming languages (go read it). His sums up with the following: Given .. 1). the abandonment of C++ and C for mainstream programming 2). the huge influence of individual programmer skill 3) the slow but steady adoption of scripting/dynamic language conventions in Java and .NET .. maybe all modern programming languages really are the same. Ole Eichhorn has already taken Jeff to task in the comments about his definition of mainstream, and Jeff has responded here so I'll leave that one alone for now ;) Several people picked up…

Joel is a bit confused about agility and design

| 0 Comments
Joel Spolsky of has just completed a very public product development project for a Windows based user assistance program called CoPilot. This has been interesting to watch and has, no doubt, generated lots of positive PR for him. He's just released the functional spec for the system and points out that "I believe in Big Design Up Front, which the proponents of Extreme Programming consider anathema. I have consistently saved time and made better products by using BDUF and I'm proud to use it, no matter what the XP fanatics claim. They're just wrong on this point and I can't…
Geoff Appleby discovers that a common C++ template idiom doesn't work with .Net generics. The code that doesn't work is this: Public Class Class1(Of V As System.Web.Services.Protocols.SoapHttpClientProtocol) Inherits V End Class which is the .Net generics equivalent of this common C++ idiom: template <class base> class TDerived : public base { }; This is useful in all kinds of situations, as Christopher Diggins explains and, as Geoff says: "You don't know if V is NotIneritable, MustInherit, or whatever. It would surely fail at compile time if that happened" which is fine. Failing at compile time is great and means that…

Garbage Collection and Pointers

| 5 Comments | 1 TrackBack
So, Richard Hale Shaw is helping us move away from C++ and in his latest posting on the subject he explains how "veteran C++ programmers" don't like to manage memory themselves; hmm. I'd quite like to see his sample data. Especially as he then goes on to define "veteran C++ programmers" as people who don't like to manage memory themselves...…

Borland C++ v3.1 and "The Raymond Chen Camp"

| 11 Comments
Last weekend was a bit of a "compiler weekend" for me; I started playing with VS 2005 and I found some old source code and wanted to build it and that required Borland C++ v3.1 (In the currently fashionable style of naming things - Borland C++ 1991). I dug through my box of old disks and found a backup of my old 386 development machine. That contained an installation of BC3.1 and, since this is from back when DOS programs ruled I simply copied the directory onto my new dev box and ran it up. After tweaking the display settings…
I've been using the latest Visual Studio 2005 beta on and off for the last couple of days. This is the first time I've bothered to try "Whidbey" and my initial impressions are very favourable; I'm just using it for unmanaged C++ at present. I haven't really done a great deal with it yet but even though it's installed on in a VMWare virtual machine it seems faster and generally less lardy than both VS.Net 2003 and 2002, which is a relief. I've mostly been converting projects and running some test builds. This is going reasonably well though it does…

I feel the need to comment on this...

| 0 Comments
Richard Hale Shaw continues his series of blog postings on "Moving away from C++" with the obligatory "pointers are bad, garbage collection is good" post... I feel the need to write something about this but not yet, I have work to do...…

/Y3 where have you been all my life

| 0 Comments
I was just flicking through some of the entries over on Games from Within and I came across an entry on precompiled headers which is a good introduction of the pros and cons of using precompiled headers in a cross platform environment. I wanted to comment on this posting but the comments seem to be turned off for it now so I'll comment here...…

Threading flames

| 3 Comments
Thanks to Ned Batchelder for pointing out the "discussion" about the pros and cons of multi-threaded programming over on the SQLite newsgroup. The comments on Ned's post are well worth reading; they've provided me with a new blog to subscribe to, Jeff Darcy's Canned Platypus which seems to have lots of the kind of high quality techie stuff that I like. My view on multi-threading is probably pretty obvious given the way my socket server framework is designed...…
I've been watching my web server logs in real time for the last couple of days, not intently; I do have a few slightly more interesting things to do. I've had a tail of the logs running on the laptop and I glance at it every now and then. What I've noticed is that the people who wrote whatever the software is that regularly tries to spam my comments are pretty crap. Sure the distributed nature of it is interesting but they really should deal with failures better. I recently "moved the front door" for my comments and trackbacks and…

Blog Explosion just doesn't do it for me

| 5 Comments
I've been attempting to boost the number of people reading this blog in the last few weeks. Mainly because the more people there are reading the more likely I am to get feedback in the form of comments and postings that link to me and I find the feedback really useful; having your views challenged is the best way to learn... Anyway, I started off by reading a load of good stuff over on Darren Rowse's ProBlogger blog and one of the postings was about a service called BlogExplosion. Unfortunately I think BlogExplosion's basic premise is fatally flawed. I don't…

Whilst on the subject of deadlocks

| 0 Comments
It must be a deadlock kinda day. Pete McKinstry points to a Java deadlock avoidance scheme which involves knowing and using a total ordering of the locks that you wish to acquire. This is similar to Andrei Alexandrescu's C++ idea of always acquiring multiple locks in increasing memory address order. Both of these are fine if you can get at all of the locks from one place. I find that that's rarely the case and more often the locks are within objects and I don't want to break the encapsulation to expose the need to lock around a method so…

Visual C++ 2005 loses single threaded CRT

| 0 Comments
From C++ Potential. In a posting about changes to the compiler switches in Visual C++ 2005 Brandon mentions that they've removed the single threaded C runtime library options. Does anyone out there use the single threaded CRT anymore? I can't remember when I last used it. I doubt this will cause me or my clients any great problems and I guess VC6->VS2003 still works ;) for those for whom it is an issue.…
Simon says; I've stopped using ?: because it isn't as readable as an if .. then .. else. ... I, personally, don't find the readability of the conditional operator (?:) a problem. No more than I find readability of assignments or pointer operations a problem. I can see how that since the conditional operator is only appropriate for use in certain circumstances, some programmers may not have come across it very often and for them it may be harder to understand than a construct that they know well. In C++ I find that I use the conditional operator most often…
Robert Scoble, and others, are discussing blog search engines at present. It's quite interesting to see that there are lots of different approaches to the same problem. Mary Hodder's article is good in that it explains a bit about the differences in how Bloglines and Technorati get their figures. I guess it's early days in the blog search engine space but none of the existing offerings really do what I'd like ;) You see, I think that these search engines could help to reinforce the threads of conversation that permeate the world of blogs...…

This should be interesting

| 2 Comments
Richard Hale Shaw is writing some blog entries about moving away from C++ (to .Net). But then he would say that, wouldn't he. His job includes providing courses for people learning .Net... ;) Anyway, I'm sure it'll be an interesting series of articles, especially given his current views on C++...…
Sahil Malik doesn't agree with Jeremy Miller's description of excessive tracing being a code smell. He suggests a 'neat' way to get around the problem but, IMHO, he's completely missing the point, and I've said as much before. Oh, and I agree with Rockford, the 'neat' way stinks ;)…

What's wrong with my CSS?

| 4 Comments
My <pre> styling looks OK (to me at least) in IE 6 and horrible (double spaced and strange) in Firefox. Can anyone tell me why? The CSS looks like this: pre { color : #990000; font : "Courier New", Courier, monospace; font-size:small; font-weight:normal; padding : 5px; line-height:100%; }…
Seems like I broke it when I added the GoogeAds for that feed... RSS 1.0 (full articles) RSS 2.0 (extracts)…

So, where's the Unix version of CodeProject?

| 6 Comments
Software development is hard. Lots of details that are hard to get your head around and harder to simplify. CodeProject is a wonderful resource for Windows programmers where programmers try and make the complicated more simple for others; I view it as giving something back. If I've spent several weeks fighting to understand a problem and now I do it's nice to write up and article and post it, either here, or on CodeProject, so that others don't have to fight so hard. Where's the similar resource for Unix?…

Linux's Dll hell?

| 3 Comments
I've been playing with Linux this week. The last time I played with Linux was back when it fitted on 15 floppy disks; I think I still have the 15 floppy disks in Dad's office somewhere. It's come a long way but I can't help thinking that, much like Windows, it still has a long way to go... Bear in mind I'm writing this from the point of view of someone who knows enough to get by and do some development work on the platform fairly quickly but not someone who knows, or wants to know, all the nitty gritty.…

And now for something completely different

| 2 Comments
One of my clients has asked me to do some investigative work for them in relation to Linux running on a Vortex86-6071LV (a PC/104 format PC which is 386 PC on a board that's around 6" x 4" x 1/2"). Should be fun.…

Is bloglines always slow?

| 4 Comments
I've been using SharpReader as my RSS reader for ages. I downloaded a version of it way back when I first got into blog reading and stuck with it because it worked, to a fashion. I ignored the bloaty .Netness of it and the fact that sometimes it disapeared from my task tray yet was still running, and that sometimes it ran really slowly, and that the way it presented new postings was a bit crap... Yesterday I decided to try bloglines instead. I quite fancied the idea of a web based reader so that I could read stuff from…

0xFF 0xFE -> CVS -> 0xEF 0xBB 0xBF

| 1 Comment
My project house-keeping yesterday ended up with a rather strange discovery. I have some test log files that contain Unicode characters and are stored on disk as UTF-16 with the correct 2 byte 'byte order mark' (BOM) header of 0xFF 0xFE. When I discovered that I needed to save some test logs as Unicode I hacked together some code that dealt with the UTF-16 BOM and did the right thing. Yesterday's mammoth CVS checkin and test was obviously the first time that I'd checked these files out of CVS and run my tests. The tests failed in very strange ways…

Working on the borders

| 4 Comments
As anyone who has downloaded any of my code from here, or my company site or CodeProject will know, I have a particular way of doing things. The code I write tends to follow a particular style and as such assumes particular dependencies. The approach that I tend to take when I'm making stuff available on the web is that if you want to use the code I'm giving away, then you need to adjust your code in whatever ways you need to be able to consume what I provide. The code I'm currently working on is a bit different…

Catching my breath

| 2 Comments
I've had a busy few weeks. I'm waiting for a client to come back to me about a quote for some work and whilst I'm waiting I'm putting together a prototype for a product that I'm interested in producing. The prototype has been going well but since I know I have a limited amount of time to work on the system I've been working to a very tight deadline. Still, at least it's of my own making and at least there's a reason for it. Today I'm doing a bit of house-keeping work (making sure all of the source is…

Code Generation

| 3 Comments | 1 TrackBack
I've spent much of this week moving from a hand crafted prototype to a code generated version of the same code. The code is all repetitive boiler plate, sort of like the stuff that MIDL generates for you. The code generated version is considerably better code and has evolved faster than the hand written code because I was free to adapt and improve the code at the "single entity" level whereas when I was prototyping the code all improvements needed to be made to all of the entities involved. Now that the code generator knows how to generate each of…

Static linking

| 7 Comments
Christopher Baus bemoans the problem of getting all the libs that he wants to use linked in statically on Linux. Chris wants an executable that will run on lots of different systems with the least amount of pain for all concerned and to do this he's linking as much as he can statically so that he has a known set of functionality available. I know this will sound like heresy, but that's pretty much my approach on Windows and it has been for a long time.…

Stan Lippman's VC6 rant

| 10 Comments
It's been a busy week. We got back from Verbier on Saturday and I'd hurt my knee, so I was sad, and limping and slow. I then had a mass of things to do to finish all of my client obligations by today. I collected up some blog postings that I was going to reply to, when I got a moment, and now I have a moment I find that one of them has vanished... Edit: Yay! for the Wayback machine ;) Here's the original posting: http://web.archive.org/web/20041211175803/http://blogs.msdn.com/slippman/ Something that I didn't mention at the time was the passion that Stan…

Stage complete - time bonus

| 0 Comments
Today was my last day with one of my current clients. In the end the hand over went well, but then I did start the process off a long time ago....…

C++ Meta programming madness?

| 6 Comments | 1 TrackBack
I find myself agreeing with Chris on this one. I just dont think I'm clever enough to use these 'modern' C++ template programming styles reliably in a way that makes the resulting code better and easier to maintain by others. I've tried, but I tend to end up with a confusing mess that I can't understand when I come back to it. What's more I often find that I can't justify the additional complexity of the result compared to doing the work in the 'old-school' non template way. I also think that there may be some truth in Chris's comment…

Busy

| 0 Comments
I've been busy recently; what with getting our trip sorted, finishing the hand over, completing the auction server and doing some consultancy for an internet market data providing company. The good news is that most things are now done and soon I'll have time to knock a few of the interesting looking items off of my "code this" list... The auction server exceeded our client's expectations; which was nice. The hand over has reached a point where I no longer feel like I'm pushing water up hill and the market data consulting is interesting and of finite scope... Preparation for…

Spammer's choice

| 2 Comments
I'd quite like to be able to harness the efforts of the comment spammers and MT-Blacklist so that when a spammer fails to comment on a posting this fact is noted and posting can get mentioned on the front page as the current "spammer's choice"... Sounds mad, but since I have a lot of content now, it would be a way of bringing some old stuff back to the front page - in the same way that the comment section does...…

VS.Net #Region

| 1 Comment
I'm reviewing some code for a client. I've decided that I don't like the #Region functionality from the VS.Net IDE... It seems to be another 'sticking plaster' to help make things 'easier' for people to structure code in inappropriate ways...…

Smash it up

| 1 Comment
I completely agree with Jeff on this one. Fear of breaking code can hold you back from making the kind of changes that are required to keep the code alive.…

NetMeeting Data Channel sample code

| 0 Comments
I've uploaded a new copy of the NMPing.zip file that is mentioned in this article. It seems that it was corrupted. Sorry about the delay in doing this, I'd forgotten about it. The code's very old, so be gentle with it.…

I don't usually do the meta-blog thing but...

| 4 Comments
I sympathise with Christopher Baus' frustrations...…

Baus waves at Scoble

| 0 Comments
Christopher Baus suggests that Robert Scoble's blog lacks focus and that his blog is mostly noise, "He's always blogging about something, but really nothing at all ". But Chris, surely that's the point of Scoble's blog? As Robert himself says "if you don't think I'm taking you to enough cool blogs, or writing enough cool stuff, there's a very easy solution. Unsubscribe.". I did that quite a while ago, but I'm glad he's still out there and that other people subscribe to him on my behalf...…

This is the book I've been waiting for

| 0 Comments
Excellent news; Herb Sutter and Andrei Alexandrescu's C++ Coding Standards book is done! This is the book I've been wanting for ages. Whilst there are other C++ coding standard books out there but, well, they just don't have the gravitas of a book written by these two and included in Bjarne Stroustrup's C++ In Depth Series. The table of contents is here. I hope the book's heavy enough to hit people with ;)…

Harvest for reuse

| 0 Comments
Jeff Atwood writes about the the delusion of reuse where he warns of the extra effort that's really required when writing for reuse: "I believe writing a truly reusable class is an order of magnitude harder than writing a single use class."…

Could someone please

| 0 Comments
Could someone please write a Java based estimating package? I really want to be able to able to turn to a manager and say, with a straight face, that all of my estimates were done in JEst... Sorry, it's been a long day.…

How hand overs become hand offs

| 2 Comments
Being a consultant, I find that the start up and shut down of projects are usually the most stressful times. Start up is all about "hitting the ground running", learning lots of stuff really fast and making a good impression. Shut down is all about hand over. Shut down is the hardest because you need the cooperation of the people you're handing over to. Whilst you can pretty much deal with any issues during the start up phase just by digging deeper or working harder a hand over with no cooperation just becomes a hand off.…

The good thing about blogging is

| 0 Comments
It makes you think. I find that when I've done a brain dump post like last night's "loader lock" posting, all of the issues are fresh in my mind. Posting just before bed means that by the time I wake up I've usually come up with lots of new ideas about the thing I just posted about...…
I've been splunking around Dll loading recently for a pet project. It's been an interesting journey and this evening I solved the final piece of the puzzle and, when I did, I suddenly wondered, not for the first time, why Windows holds the loader lock when calling DllMain()...…

WTF?

| 0 Comments
Ah, a place to keep all that bad code... The Daily WTF From Barry…

LoadLibrary error

| 4 Comments
I need to dynamically load a dll, grab some function pointers and do stuff; simple stuff, done it 100s of times before. I decide that this time I'll wrap the HMODULE that I'll need in a class to make sure I can never forget to call FreeLibrary() on it - RAII is your friend. It's Sunday, I'm feeling righteous so I'm doing it in a TDD style. I write some tests, load a dll, load a bad dll to check error handling, load a dll that doesn't exist... So, what do you expect happens when you call LoadLibrary() on a…

Doxygen niggles

| 6 Comments
I've been using Doxygen recently. It can scan a body of code and produce reams of linked documentation and diagrams. I, personally, don't really use it for its documentation, just for its diagramming. I've always believed that if I can't draw a neat and tidy picture of the relationships between pieces of code then the design needs fixing.…

Platform, push off

| 0 Comments
However, I still prefer that all these technologies should be introduced and made exclusive into Longhorn, because of the enormous benefits a comprehensive base platform provides. By requiring an upgrade, Longhorn would cause a mass shift to a new platform and offer developers a new minimum level of operating system functionality, a la Windows 95. From .Net Undocumented Riiiiight... I'll remember to tell all of my clients who are only just finishing moving from NT 4 that they'll need to move everyone again real soon now because it'll be more convenient for developers...…

Brute force marshal by value

| 0 Comments
This week I integrated the new data provider with the rest of the client's existing code. The integration was pretty easy as the existing code deals with the data provider via a single method on a COM interface. All that was needed was to adjust the calling code to use the COM object rather than the local implementation and everything just worked. The good news was that the call to get the data was now 100 times faster than it was with the old code; the bad news was that processing that data took almost three times as long. The…

Excellent piece on exceptions

| 2 Comments
IanG on Tap: When to Catch Exceptions - the answer is, of course, not as often as you'd expect... Ian's talking about managed code as can be seen from his final comments about expecting to see many more finally blocks than catch blocks, of course, in a proper language ;) like C++ you don't need any try blocks at all as RAII will deal with all your resource management for you...…

The Exponential Nature of Lines of Code

| 0 Comments
The faster your codebase grows, the less of it people will understand. When people don't understand all of the code, they don't see global patterns, and so they will reinvent little wheels all over the place. In theory, the development leads and the architects are supposed to watch out for these issues, but there are always places where redundant code can hide, and as the code continues to grow, even this watchdog function breaks down. Soon you have people who are intimately familiar with only a couple of modules in the system, and so replication across modules becomes difficult to…

Failed

| 0 Comments
On Tuesday I wrote about the start of this week's gig. Now that the week is over I guess an update is in order. In summary; I failed to work miracles this week...…

Caring

| 0 Comments
There was a good reply by Dr. Real PC on one of Joel's discussion threads recently; "The most important thing is caring. If you don't care it doesn't matter how smart you might be. If you aren't interested how could you have the patience that's required?" How true. I think it's reasonably easy to spot if someone cares about what they're doing, or, perhaps it's just easy to spot when they dont...…

Sick of the R word

| 4 Comments
I'm getting a bit fed up of hearing the word 'Refactoring' when what people really mean is just 'hacking at code'. Back in May last year I responded to Bob Cringely's piece on how bad the whole idea of refactoring was; I still stand by what I said and, looking back, I think the key point is this: "Not all code changing is refactoring. Refactoring requires discipline. You need to balance the risk of refactoring with the risk of not refactoring. You need to know when to stop and you need to do it because it's the right thing to…

Explicit class initialiser methods

| 20 Comments
Codemonkey uk has an interesting piece on the use of explicit initialiser and destroy member functions rather than allowing object lifetime to be managed by the constructor and destructor.…

Reprint: CORBA - Reference Counting

| 0 Comments
A new posting in the blast from the past reprints area. First in a series that compares CORBA and COM; CORBA - Reference Counting.…
The one where I find that you can teach an old dog new tricks and almost use the 'rocks' word.…

Comment Spam Morons

| 0 Comments
Hey, you comment spam morons, get a life and do something useful for a change. With MT Blacklist most of you are kept out (and I can see how effective it is from looking at the logs) and it takes me no time at all to clean up after the few of you that get through and post your pathetic excuse for advertising. One click on the email that I get sent when a comment is left adds your pathetic spoor to my blacklist and another click scans all other comments and removes the crap you're spreading. ZZZzzz...…
Reusing code is often harder than you'd think. Sometimes the decision not to reuse a piece of code but instead to write new code to do the same thing is not just a case of 'Not Invented Here' syndrome but is more a case of trying to 'Use Someone Elses' and finding that the fit isn't quite right...…

Currently reading

| 0 Comments
I currently have 3 quite different technology books on the go, and one waiting in the wings. I'm re-reading Software Craftsmanship, McBreen's ideas really appeal to me, but then I guess that may be because I went through an official apprentiship in a former life so I can see how the craft model might work well for software. Next is Applied C++ which is an interesting 'warts and all' journey through the design of a graphics manipulation library in C++. I particularly like the fact that the authors don't necessarilly give you any hints when they're exploring a technique that…

Staying focussed on the finish

| 0 Comments
The data provider project rolls on and we're almost at 100% of the functionality required for version 1.0. In fact, we have a few 1.1 features in there because they were easy wins and by the time we made sure that we they'd be easy to do in 1.1 we found we'd done 90% of the work for them. The task now is to avoid the numerous distractions, improve test coverage, integrate with our clients and hit the ship date.…

Code that's like a box of Lego

| 0 Comments
I've been noticing that since I started doing the testing thing in anger my objects tend to be smaller and I have more of them. The pressure that testing puts on you to design in such a way that each object can be used as independently as possible so that you can write tests seems to break chunks of functionality far better than other design methods I've tried. As I've said before, the problem then becomes one of managing the obvious complexity; looking at this kind of code for the first time can be a little daunting.…

Firm Foundations

| 0 Comments
As I mentioned last week, I'm writing a new component for one of my clients. I also mentioned that 'beyond the interface, I can do what I like'; that's actually a surprisingly important part of the specification due to the situation that the client finds itself in...…

Repeat after me, COM is just an interface layer

| 5 Comments
I was reading this the other day and I recognised Past Mozilla Mistakes: two as something that quite a few (if not all) of my clients have made...…
Joel has written a nice little piece on the demise of the Win32 API. Some of it I agree with; such as for many developers the fact that .Net is just the latest example of Microsoft indulging in a Fire and Motion exercise, yet for other developers it's vitally important; the trick, as ever, is working out which camp you fall into... But some of it, I don't.…

Pimply youth

| 0 Comments
Last week I spent some time back with the guys on the refactoring project. Things are going well for them and, apart from a few minor transgressions, they're sticking with the process that we put in place when I was with them on a regular basis. The project is currently suffering from a slight lack of technical direction; they have a new guy on the team and he's enthusiastic to try 'new' things and nobody is currently restricting the things he is allowed to try...…

This still amuses me

| 0 Comments
A long time ago, in a galaxy far, far, away... I wrote a short review of The C++ Programming Language, 3rd Edition. Which, for some strange reason, Addison Wesley decided to quote on their page for the book in question (click reviews, the page is too clever to allow a direct link), along side an Amazon review and a review from Computer Literacy Bookshops... I laugh every time I stumble across that page...…

Block

| 0 Comments
My brain has been too busy to think recently. I've had too many background issues going on, too many unresolved items, too much shit to deal with. I haven't been able to think new things because I've been too tied up in the unfinished things, I've tried really hard to think but there wasn't any space... It sucked. Today I cleared a lot of that away; I found closure on lots of items and generally would be able to think nice shiny new thoughts right now if I hadn't relaxed with a little too much wine over dinner. Ah well.…

Designing to be inherited is extra effort

| 4 Comments
I saw this rather nice explaination for why sealed is used in so many .Net classes over on cincomsmalltalk.com as a comment to a rant about how .Net is bad for your design skills... Designing to be inherited is extra effort [Shane King] April 16, 2004 20:26:54 EDT It's extra effort, since you have to think about not only what public interface to provide to users of the class, but also what interface to provide for people who want to inherit your class. Often it's just not worth putting in that effort. Marking your class as sealed is a way…

MT-Blacklist

| 3 Comments
Well, so far I'm very pleased with MT-Blacklist. It works well at preventing comment spam and when some spam gets through it's very easy to update the blacklist and then run the 'despam' option to remove all traces of the offending material. 10 out of 10!…

SOA, coupling, flexibility and discipline

| 0 Comments
Some thoughts on Service Oriented Architectures and how for some people the silver bullet du jour is the only tool in their toolbox... Just a bit of a rant really...…

MT-Blacklist

| 0 Comments
Sorry about the comment spam whilst I was away. I've now installed MT-Blacklist, so hopefully the only offensive rubbish and stupid sales-pitches on this site will be my own... MT-Blacklist seems pretty good; it cleaned up the mass of spam with one click but then unfortunately failed to block a new piece of crap that was posted this afternoon. Having added one of the offending urls to the blacklist I ran the cleanup again and it removed the offensive comment and automagically added the other urls that the comment contained to the list... I'll write more about it once I've…
"I'll bet you that from ten feet away I can tell if a program is bad. I might not guarantee that it is good, but if it looks bad from ten feet, I can guarantee you that it wasn't written with care. And if it wasn't written with care, it's probably not beautiful in the logical sense." Charles Simonyi…

Code review

| 0 Comments
I'm reviewing a large body of code for a client at present. It's a general review of the design, coding style, code correctness and testability of a project. I started off by making notes on some of the general design changes that I'd recommend and eventually got down to a detailed review of the code. There's a lot to say about the code and, as with all code, sometimes it's hard to figure out the reason behind the use of a particular construct. I was starting to think that the note taking was going to take an age when I…

Const correctness

| 2 Comments
Interesting thread over on Joel today about using const, or not. The original poster asked how many people bothered to mark function parameters that they don't modify as const and whether there was any performance or readability advantages in doing so. Ignore any performance issues, making your code const correct has massive readability and comprehension advantages. I'd go so far as to say it's one of the most important coding standard issues there is...…

Cypher

| 0 Comments
I'm currently working with a corporate client. The plan is that I'll help them refactor a key component in their system and make it more robust and increase performance. Right now they're in the middle of a release and are in 'slip mode'. I find myself feeling some sympathy for Cypher from The Matrix; there I was, safe in my green-tinted world of TDD, then suddenly I find myself in "The real world" and it's nasty and messy and there aren't any tests. Now I wish I could get back to where I was and I don't care if it…

Adding layers without adding value

| 2 Comments
I'm a great fan of wrapping stuff up with thin layers that make the wrapped code easier to use in a given circumstance, or to provide a more appropriate interface. Obviously there are other reasons to wrap APIs but I'm continually amazed at how often the wrapping fails to add much value.…
STL containers are great. Rather than have to worry about writing doubly linked lists, efficient maps, and other such data structures you just grab one from the STL and you're away. Unfortunately the STL containers have quite a large 'surface area'. Their interfaces are rich because they are generic containers. Often the container you actually need is much more limited in scope and in such situations I always find it's worth wrapping the STL container and providing a more appropriate interface to the user.…

Thought for the day

| 0 Comments
If you don't write the code are you doomed to forever be thinking that the abstraction is all in the wrong place? Another day, another dollar. Starting with a new client, well starting back with an old client, and doing that 'get your head around the source' thing...…

An abstraction too far

| 0 Comments
Today turned into a day for pondering complexity, abstraction and memory management and watching Pirates of The Caribbean on DVD... I experimented with a version of the buffer allocator that allowed a user defined memory allocation policy. It worked, but it was, I think, unnecessarily complex. If the buffer allocator itself lay behind an interface then that's enough flexibility. Additional abstraction, with an abstract allocation policy in addition to an abstract allocator seemed a tad too abstract... At some point you have to actually make the decision and write the code that does the work. An interesting day's thinking; the…

More on the bug

| 0 Comments
As I mentioned earlier, I found a memory leak in a piece of code and was lamenting the difficulty in providing automatic tests for such a think when you use new and delete directly. I've thought about this some more and I'm now slightly less concerned...…
We have lots of clients who haven't moved away from VC 6 yet. At present we need to maintain all our projects in a VC 6 compilable form. The easiest way to do this is just to use VC 6 as our primary development platform for C++. If we had a tool that allowed us to back port VS.Net 2003 projects to VC 6 then we could maintain the projects in the latest format and back port as required. As it is, we need to maintain them in the earliest format because we know that the newer compilers will always…

Why is Outlook 2002's POP handling so slow?

| 1 Comment
I ran Outlook against my POP3 server just now and once again was unimpressed by the speed that messages were being downloaded. It seems that Outlook 2002, over an SSL link to a POP3 server (so no anti-virus weirdness is going on) takes about half a second per message to download a large number of really small messages, from a server on the same machine... Because I'm curious, and because it doesn't appear to be a server issue as the server idles the whole time, I ran up Outlook Express and pointed that at the server (same SSL connection), it…

I hate things that turn off the explorer status bar

| 0 Comments
<rant>Whoever decided that it would be a good idea for the explorer status bar to be 'switch offable by someone other than the user' should be taken outside and given a good kicking. Why is it a good to let someone other than the user decide what's the best way to display information?</rant> and don't get me started on folder views that reset themselves to the dumb ass icon display for no apparant reason...…

Is Open RBL a crock or is my DNS set up wrongly

| 4 Comments
One of the people I email's corporate mailer has started to bounce my mail with the following message: mx.example.com[xxx.xxx.xxx.xxx] said: 554 You have been blocked by a DNS blacklist, please see:- http://www.openrbl.org/ (in reply to MAIL FROM command) So I wander over to www.openrbl.org and type in my domain name and it tells me REJECT: invalid ip-address or non-resolvable hostname: jetbyte.com... Now, it's true that jetbyte.com doesn't have an ip address, but it has a perfectly valid MX record... Shouldn't OpenRBL be checking that the MX record is valid rather than checking that the domain has an ip?…

You learn something new every day

| 2 Comments
I'm writing some tests where I need to log calls to function for the test log so that I can make sure the function is called in the expected way when the test runs. The logging version of the object under test derives from the object and adds the logging functionality and calls the object under test to do the work. Of course, for this to work, the functions that I'm interested in can't be private. Some of them were and I was dissatisfied with my current solution (reclassify them as protected because the test needs to access them) and…

.Net 1.1 TCP/IP wierdness fixed

| 3 Comments
"Additional information: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full" I've managed to get the .Net 1.1 TCP/IP issue that gives the above error mesage when trying to use sockets on .Net 1.1 fixed. Thanks to Alex Lowe for pointing me in the right direction and for the guys at MS support for allowing me to call them up and tell them I need to download the hotfix for KB 826757.…

Quality of MS developer support

| 2 Comments
Alex Lowe asks what Microsoft could do to improve their developer support. In general I think they do a reasonable job given the huge surface area of APIs and products that need support; I think some of the MS staff blogs are helping too. But they could do more...…
Roy's post about information hoarding made me think, which is always good... Last night I followed a link from Larkware to this article on MSDN about Pocket PC services. The article annoyed me, I'd have preferred that it had been better edited, but given the choice between having the information that's in the article available or having it sitting in someone's mailbox waiting to be edited I know what I'd prefer. As far as the MVP's go, I'm happy they're there and it's great when they can help, but I'd rather have access to all and any snippets of information…

We want information, information, information

| 3 Comments
Who are you? The new number 2... Who is number 1? Looks like Roy Osherove is making waves with his comments about MVP information hoarding... Having been in the position of being a developer searching for scraps of information on a MS technology that doesn't appear to be documented as well as it could be I know where he's coming from.…

Thought for the day

| 0 Comments
There are two ways of constructing a software design; one way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. - C. A. R. Hoare From Joel's discussion board...…

Bitten by the one definition rule

| 0 Comments
I've just wasted 20 minutes or so on a nasty bug. I'd added a bit of test code and suddenly some other tests were failing but the reason for the failure seemed to be that a class's vtable was getting screwed up and a virtual function was jumping off into hyperspace... After some time stepping through the code for a while I could see that a function that should have been incrementing a data member was in fact stomping over part of the vtable. It looked like the compiler was failing to allocate the correct size for the object, which…

In C++ why isn't this a reference?

| 5 Comments
In C++ every object has a "this" pointer. You could think of it as being passed as an implicit argument to every non static member function that the object has. It can never be null so why isn't it a reference? The reason I started wondering about this is that when using wiring objects together, such as when using parameterise from above, I often find myself wanting to pass a reference to the current class to some related object. More often than not I actually want to pass a reference and not a pointer, because the relationship is not optional…

Template shims

| 5 Comments
I needed to implement the same interface twice in one object today. It took me a while to remember how I do this kind of thing so I thought it was worth a blog posting so that a) I can find it at a later date, b) other people can tell me of better ways to do this, and, c) other people can use the technique if they want to...…

.Net 1.1 TcpClient strangeness

| 2 Comments
There seems to be a wierd bug with .Net 1.1 and sockets...…

Use and misuse of C++ nested classes

| 2 Comments
I like nested classes in C++. They allow a nicely fine grained approach to naming. Where a class may need to be called CRegistryKeyIterator if declared at namespace level it can be called Iterator if nested inside the CRegistryKey class. The problem is I think I tend to overuse the feature...…

2003, The year of the test

| 0 Comments
Looking back on my blog entries for 2003 it's reasonably obvious that the big thing for me in 2003 was testing. TDD seems to work well for me and my clients. It's not a silver bullet but it is a useful tool and I find that when you're operating in TDD mode that nice code just unrolls in a nice, stress-free manner. What's more, the code usually seems to turn out better than that produced without using TDD. The structure and design is more flexible.…

New Year

| 0 Comments
A combination of events in the run up to my Christmas break meant that I have ended up spending almost 2 weeks without feeling the urge to write any code. I've just chilled out and relaxed, watched some DVDs, saw LOTR ROTK, played some SSX3 and ate and drank too much. At the weekend I started to get my head back into coding thoughts by restructuring a couple of libraries that make up The Server Framework. There is a need to use async file reading and writing using IOCP and this code will be similar enough to the existing network handling code…

Thinking, Discipline and Courage...

| 1 Comment
Wayne Allen asks why so much code is so bad? Why the majority of code, even new code, that he sees as a consultant is terrible. Meanwhile, Rory Blyth is complaining about "Paper bag" code. I think Wayne hits the nail on the head with his comment about much of the problem being down to the individuals involved willingness to learn and change. But there's more. Doing a good job requires lots of thinking, lots of self-discipline and lots of courage. Finding programmers who can do all of that and program in the required language is hard...…

F Lock fix

| 2 Comments
Ok, I usually hate those 'me too' blog postings but... Here's a "fix" for the fact that on Microsoft keyboards that have an "F Lock" key to change how the function keys work the default power up state is "wrong".... From "The furrygoat experience", via "ISerializable". Thanks guys...…

Bluetooth on XP

| 21 Comments
I never expected the Bluetooth sockets entry to be so popular ... From the comments on that entry it seems a lot of people are having trouble with getting devices to work with XP's bluetooth support. To help out a little here's my proof of concept test project.…

I'd like a refactoring lint

| 4 Comments
So a refactoring editor doesn't float my boat; a lint tool that warned me that there were bad smells in the code would... Right now I use Gimpel Lint as a code review tool. I run it, it tells me nasty things about the code, I listen, fix or ignore. It would be nice if it could tell me that there were bad smells. I think this is where real value could come from refactoring tools.…

A sustainable pace

| 5 Comments
Ok, it's that 'wine' time of the evening. Miche is working late, I've eaten and am close to finishing off a nice bottle of Pinot Noir and my thoughts turn to people being excited by refactoring editors...…

iPaq upgrade

| 2 Comments
Finally got the Pocket PC 2003 upgrade for my iPaq 3970. The upgrade went nice and smoothly and the iPaq feels quite a bit faster and everything seems a little more polished and easy to use. So far it seems that it was worth the money...…

Way behind the curve

| 0 Comments
I know I'm way behind the curve with this, but... I downloaded Virtual PC from the MDSN subscriber downloads at the weekend. It rocks. I needed to try something out on a Windows 98 box and I didn't fancy repaving one of my machines so I went virtual. What's cool is that once you've booted the virgin virtual PC and installed your OS of choice you can just copy the drive somewhere and use it again and again. So I installed and tested what I needed and I still have a clean Windows 98 box in a box. I installed…

Sniff my packets!

| 1 Comment
Barry sent me an interesting link to a piece that points out just how easy it is to bypass wireless network security. I wonder if you can get a Bart Simpson shirt with him saying "Sniff my packets" rather than "Eat my shorts"...…

lessonOfTheWeek == !onesize.fits(all)

| 3 Comments
I've enjoyed the hoo har over exceptions this week. It's made me think and analyse and reassess what I do. I'll be continuing pretty much as before, but it's worth spending the time to think about these things once in a while.…

Unexceptional examples

| 4 Comments
We're going to run out of amusing titles for these exception related blog entries sooner or later... Joel wants Ned to rename the functions in his 'exceptions are better' example. He wants InstallSoftware(), CopyFiles() and MakeRegistryEntries(). Jesse Ezell leapt in with a C# version which includes the rollback functionality that Joel was undoubtedly hinting at. The thing is, although Jesse is defending the use of exceptions, I think his example is making the case for the other side...…

Exceptions are for exceptional situations

| 0 Comments
Like drumming up traffic to your site, perhaps? ;) On Monday Joel Spolsky wrote a controversial piece about exceptions; he hates them. Much blog cross linking and local discussion ensued. Today he's followed that piece up with a piece that basically says 'exceptions can be good and they can be bad, it's a design tradeoff'. Which, of course, takes all the controversy out of the original posting; strangely I was expecting something like this...…

MSDN Reloaded

| 0 Comments
Wheee. I can throw all of my existing MSDN disks in the disk bucket and I don't need to keep wondering which is the latest version. They've changed my subscription 'for the better'... Hmm, it seems that now the colours will be used to identify the type of disk (I'm sure that's how it used to be before they changed the subscription 'for the better' last time around) and the major numbers will stay the same when a disk replaces another disk, only the minor number will increment... Sounds sensible... I hope it works.…
The harvesting of the SSL server code took about an hour in all. It was simply a case of shuffling some code around, ripping it out of a project and into the library and then adjusting the original server and the POP3 server to suit. So, I now have a POP3 server on 110 and 995; and Outlook even lets me know that my server certificate is bogus... I guess I need a real message store now...…

Harvest Time

| 0 Comments
I had a bit of spare time today so I finished the POP3 server integration. It went nice and smoothly and I tested the result with telnet and Outlook. During the Outlook testing I noticed the 'this server requires a secure connection (SSL)' checkbox. I hadn't been aware that there was a standard port (995) for accessing a POP3 server over SSL. My server currently only supports port 110 for unencrypted transport but I've got code that can turn my server into an SSL enabled server... Looks like it's time to harvest that into The Server Framework.…
Joe Bork explains why he now tells people he works on Word as a way of connecting with something people understand. I found that people seemed to understand what I did if I compared Word to a Moss Bros suit and then explained that I was a Savile Row tailor.…

Windows update should...

| 4 Comments
Windows update should let you flag updates as things you dont want. You should be able to add some text if you want; so it can remind you why you didnt want it, and say to it "don't show me this one again unless I ask...".…

Comment rot

| 0 Comments
There's an interesting discussion going on on the ACCU's mailing list at present. It's about the value of comments in code. This is one of those topics that comes around every so often and this time I decided to dive in with some controversial suggestions.…

"The sample code uses limited error handling"

| 2 Comments
I'm looking at adding SSPI security to the socket server code for a client; first stop is MDSN and the samples section. Although I can understand why the MSDN samples are generally just 'here's the API, this is the order you call things in, run along now', I think it would be nice if they were better; especially since I often find pieces of pretty much untouched MSDN sample code deep within client's applications... I guess it's not really something for Microsoft and the MSDN team to provide though... Pity.…

Frankenstein programming

| 6 Comments
I'm spelunking around in some code for a client looking for a nasty bug that's hard to reproduce. The code is less than ideal... It's the kind of code that's been put together by what I refer to as 'Frankenstein programming'; lots of unrelated bits and pieces have been collected from various places and stuck together to make something that looks about right. Unfortunately we're at the point where we need a vast amount of power to give this thing life, and I for one don't see a thunder storm on the horizon...…

No, No, No! That way lies the army of muppets!

| 0 Comments
Krzysztof Kowalczyk on Alan Cooper on software business... "Alan Cooper argues in this article that a way to win in the software business is not by cutting costs of production (i.e. number of programmers and their salaries) but by investing more in creating good software (i.e. hiring more programmers)." My emphasis; I don't think that's what Alan's suggesting.…

Things that make you go, Hmmm...

| 1 Comment
Just yesterday, I had a discussion with the CTO of a current client. He's a 20 year industry veteran and he was wondering why Microsoft hadn't stopped in their tracks and underwent some massive code reviews to get rid of the problem for once and for all. ChristophDotNet Because it's a very hard problem? How many lines of old code have you and the CTO personally reviewed and decided were completely bug free?…

Damned if they do, damned if they dont

| 4 Comments
I had just sold management in the company I am clienting for on the ability of W2K3 to avoid these, with the line that during the Windows Security Push, all 9,000+ Windows developers stopped and poured over essentially every line of Windows code remove these kinds of situations and make W2K3 the most secure OS. Now two of these in the last month. To say that this has stopped a massive redeployment is an understatement.Sam Gentile's Blog So you oversold an idea to a client and now you're mad at Microsoft? You're concerned about the security of your server platform.…

Why do I code? Because I couldn't not do it...

| 0 Comments
Why do any of us do this stuff? Why do we read so many books on the subject? Go to user group meetings? Fly across the country to hear people talk? Why do you code? Seriously. I want to know. Rory Blyth - Neopoleon.com - WHY DO YOU CODE? Because I have to?…

iNTJ

| 0 Comments
So, I saw all this stuff over on Scoble and Chris Sells' blogs about Microsoft being full of ENTJ's and wondered what the hell they were on about. Myers-Briggs personality types; I took the test, apparently I'm an INTJ... Well, the descriptions read about right; though I expect my Michelle and my sister might have something to say about them...…

Netgear MR814v2

| 7 Comments
Further to my recent wailings about being responsible for family member's PCs... I decided to deal with the internet connection sharing issue at the hardware level... So far the Netgear MR814v2 firewalled, DSL router, WIFI access point seems to rock...…

Eric Sink on instant gratification

| 0 Comments
Eric Sink has an amusing piece on how his problem solving skills have been spoiled by Visual Studio's F5 rebuild and run option. He obviously isn't developing test first, because if he was then going for the instant gratification of a green bar is fine.…

Insufficient coverage

| 0 Comments
Today the FX engine went into UAT. Well, the nearest thing we have to UAT; a user looked at it... 3 bugs, differences between the new code and the current production version. All slipped through our test coverage. :(…

You can lead a horse to water...

| 2 Comments
Although the other developers on the refactoring project agree that the code needs to be made better sometimes they don't seem to bother to make changes in a way that improves things... This week a major new piece of functionality was completed. I helped with merging the branch back onto main and started to sort out the release; then I realised none of the test harnesses compiled anymore...…

Decoupling the FX GUI

| 0 Comments
The rates engine was now easy to test but the interaction between the engine and the user wasn't. This was unfortunate as the interaction is reasonably complex. We hadn't built and tests for any of the GUI code yet, last week we fixed that...…

FX Testing

| 0 Comments
By Friday our FX test harness was pretty much complete. We had coverage for all the nasty special cases that had caused us problems in the last few weeks. They were the hard things to write tests for so we wrote those tests first. If we can these these things we can test pretty much all of the FX engine's functionality. Now we just need to add back the functionality we removed when we were chainsawing the FX code out of the GUI code. Once that's done we'll merge this branch back into the main tree and test and release…

FogBUGZ

| 0 Comments
We're approaching the end of this phase of the poker game project. The client has started reporting lots of little things that don't quite work how he'd like them to. Some are bugs, most are feature requests, either way there's suddenly more of them than I'm comfortable managing with lists on paper and email trails. I decided that I needed a proper way to track these things. I looked at Bugzilla but it looked like I had to invest thinking time in it; I looked at FogBUGZ and it didn't. I bought FogBUGZ early in the week and it installed…

You'll tick when I say so and not before!

| 0 Comments
Today we wrote some complicated FX business logic tests. Things like making sure that the FX library can calculate a EURUSDCAD 1M rate - it can; or a USDCAD ON rate - it can't and nobody had spotted the fact that it was out because it's way down in the 0.00001's of the rate.…

The first FX test

| 0 Comments
On Friday we got to the point where the FX buiness logic code was suitably decoupled from the display logic that we could write our first test for the business logic. In the words of Homer Simpson, "Woo hoo!".…

FX refactoring

| 0 Comments
Bleugh! You are lost in a maze of crapy code, all alike (and much of it copy and pasted!). The last few days have been deep in the heart of darkness. Gently teasing the business logic and the display logic of the FX code apart so that we might one day be able to write tests for the business logic.…

The good thing about this web log lark is...

| 0 Comments
Writing stuff down makes you think about things. Take the "balls in the air" piece. I had a problem, I didn't realise what the problem was until I wrote about it and now, a week later I see the problem coming up again and know what it is and how to avoid it. Magic!…
As I mentioned a while back, the refactoring project's FX functionality was developed by guess work. We're fixing that now by spending some time gaining an understanding of the problem domain as we refactor.…

Polishing

| 0 Comments
Hit a deadline early this afternoon and hadn't chased up some requirements so I ran out of things to implement. Faced with a couple of hours spare I whipped out Gimpel Lint and started to polish...…

Uncle Bob talks lots of sense

| 0 Comments
So, I read my own blog and follow the links I put in the entries, does that make me a bad person? After writing the post on Bob Martin's book I went off to read his blog, good stuff, read it!…

The onset of infection

| 0 Comments
I've spent the morning doing test driven development, properly; writing tests first and everything. It works, it's faster and it's addictive.…

Currently reading

| 3 Comments
Agile Software Development - Principles, Patterns, and Practices by Robert C. Martin This book is physically heavier than most of the books I've been reading lately but I'm still carrying it to work even though I only get around 5 mins reading done on the tube during the journey. It's a beautiful book; the typeface and illustractions are stunning, the paper feels rich, the cover is cool and colourful. The content is pretty good too. Robert Martin knows his stuff and this book seems to pull all of the things that I'm currently interested in together in one place. I'm…

Keeping all the balls in the air

| 4 Comments
A while back Carson asked me how I managed to keep track of all the projects that I was working on; I said that I had practiced being productive over short time periods, tried to stay focused on one thing at a time and not to switch projects too quickly. There's more to it than that though as I found out recently...…

Free software integration code drop

| 0 Comments
The free source code integration project has its first code drop and then its second code drop... Almost complete. The integration has gone pretty well. The server code now has a neat little facade that allows it to impersonate the MFC server code that the client wants to replace.…

Big blind, little blind

| 0 Comments
The online game approaches completion but recently the requirements were lacking and we couldn't see the way forward. We're finishing the game play and getting to the complicated special cases - I'm hoping that they won't be complicated or special once I understand them more... The original story that explained the latest piece of work was lacking when we analysed it closely; we fleshed it out and now I think we understand it enough to quote for it and code it. We'll see. At least we're still moving forward, albeit slower than we'd have hoped.…

Unsound FX

| 0 Comments
We've been moving pretty quickly on the refactoring project. We had got to the point where we were doing at least two releases a week. Generally we would include user requested fixes in the first release and refactored code in the second. It started to become a little hectic. Last week we decided to slow things down a little so that we could regroup...…

Big ball of mud

| 0 Comments
Brian Foote and Joseph Yoder writing about software architecture (or the lack of it). Thanks to Bryan Boreham for the link.…

Untestable 2

| 0 Comments
A couple of days ago I posted some untestable code. I've had a couple of emails saying that people couldn't see why the code was untestable. Here's why, and here's how to fix it.…

Waltzing with Bears

| 0 Comments
Finally finished reading Waltzing with Bears: Managing Risk on Software Projects and it was well worth the read.…

Three bugs went into a program

| 0 Comments
Three bugs went into a program; a memory leak, a misunderstood interface and a deadlock...…

My Name is Len Holgate, and I'm a workaholic

| 5 Comments
Given that the work I do goes on in my head and can be done anywhere I find that it's often done everywhere. Anyone got any hints on how to switch off?…

In the future, there will be robots!

| 4 Comments | 2 TrackBacks
The code generation crowd are at it again. So, "writing code" is stupid is it? Well what will we call writing the requirements in a form that the code generators can understand and why will it be easier to get the requirements right?…

Changing the vinegar

| 0 Comments
A while ago I likened writing articles about code with pickling it to preserve it... It seems the last few days have been spent changing the vinegar...…

Pinging down NetMeeting data channels

| 7 Comments
Back in 1999 Darren came up with a cunning plan to make lots of money. The plan was 'device control over the internet'... In summary, we didn't.…

Wise words

| 1 Comment
"The most successful method of programming is to begin a program as simply as possible, test it, and then add to the program until it performs the required job." -- The PDP-8/e Small Computer Handbook (DEC, 1972) - Chapter 9, Page 9-64 Just what those agile guys are saying! from Joel.…

Top tip

| 2 Comments
For those of us still working with VC 6... This page about all the clever things you can do in the debugger watch window is pretty cool. I knew all about s and su and hr but I didn't know about m, that one's way cool. Hmm, looks like all of these work in VS.Net 2003 too :)…

OBEX and ISO8583

| 4 Comments
OBEX is a nice little protocol and reminds me a bit of a massively simplified version of ISO8583. It's a pity about the warts on Connect...…
So, we have currency based limits and they're in millions. Us: "Are they always going to be in millions for all ccys?" Them: "Yup." Coded, tested, delivered. Them: "can we have the JPY limits in billions?" Us: "US or European?" ;)…

Switching to CVS

| 0 Comments
For my sins, I've used Source Safe for version control on quite a lot of my projects in the past few years. It's got its faults but, well, the price is right...…

Analysing my blogging

| 0 Comments
I see a trend here... So, I blogged, I ate, I had a little wine. And started thinking...…

Giving it away

| 0 Comments
I give a lot of source code away on the web. I have done for several years. Often when I tell people about this they try to convince me that I should be selling the code rather than giving it away. They don't need my code and are way more business savvy than me and they come up with all manner of clever ways that I could do this, but this is why they're all wrong...…

Analysing my analysis

| 0 Comments
In my usual "don't read the manual" style I crufted together a simple OBEX decoder, fudged a response to the connect message and watched my iPAQ send the first chunk of the file I'm using as my test. Now I'll throw away this crummy piece of code and write a proper OBEX protocol handler.…

It's important who's driving

| 0 Comments
I'm a firm believer that software rots unless you're very careful; and like apples, once one piece starts to go bad the rest quickly follows. The Pragmatic Programmers talk about Software Entropy and The Broken Window Theory and, unfortunately, this week the refactoring project showed how true this is...…

80 00 1A 00 0F D7

| 164 Comments
My dabbling with Bluetooth continues. Using WSASetService it's pretty easy to get your device to advertise a standard Bluetooth service on one of its sockets. Simply create your socket with the Bluetooth address family, bind and listen as normal and then call WSASetService to start advertising a service on this socket to other devices within range. Now call accept and wait... I chose the File Transfer Service as my hello world service. Get one of your other devices to discover your services and the new service should appear. Connect and your accept will return a connected socket. Issue a recv…

Bluetooth sockets

| 436 Comments
This morning I decided to investigate the Windows XP SP1 Bluetooth support. I played with the BluetoothXXXX API and quickly became disapointed. I then moved on to looking at how to access the Bluetooth hardware using Winsock and decided that is a much better route to take...…

Working for Microsoft

| 0 Comments
Andy Hopper has written about what makes the thought of working for Microsoft appealing to a geek. "It's presented as a tough place to work even if you're a wizard coder. It's also described as a meritocracy - Impress or Be Forgotten. I honestly don't know if I could survive, and that is the exact reason why I want to do it " Agree.…

New toy == good

| 5 Comments
The new laptop is way cool. All the stuff is now installed and it compiles nice and fast... The batteries last well, even when the screen is bright and the disk is quiet. I can sit on the sofa and code without being told off for disturbing the TV watching... The keyboard is SO much better than my aging Dell brick... Haven't yet needed to try the WIFI, I have CAT5 points everywhere in the flat anyway... The Bluetooth hardware is MS compatible, so I can write that wrapper code now...…

Stuff

| 0 Comments
The refactoring project rolls on. This week was mainly taken up with managing a seemingly infinite number of minor releases. We decide to appear "responsive" by reacting to recently reported, low priority, issues quickly whilst never seeming to make progress on long term plans... Hmm... We're moving foward, but it's slow going. We don't currently seem to be taking into account the overhead required to make a release. Management people don't seem to realise that if they keep insisting on us 'fixing this now for release tomorrow' then it takes a bit longer to get the other stuff done :(…

Password policies

| 0 Comments
Someone in an organisation decides that people's passwords aren't secure enough. They implement a policy so that people are forced to change their passwords on a regular basis. People find that changing passwords is a pain so they work around the policy by using a 'system' when they change their passwords. Rinse. Repeat.…

The colours thing bites

| 0 Comments
A while back I found what might politely be called "a mixing of business logic with display logic" issue in the refactoring project. Yesterday it bit me...…

New toy

| 2 Comments
My old laptop was a brick that didn't run VS.Net fast enough for my liking, so I thought it was time for an upgrade. I went for the Sony Vaio PCG-Z1SP because of the weight, screen, wireless connectivity and the fact that I can slap 1gb ram in it. Oh, ok, and it's pretty sexy. First impressions are good; it's light, bright and fast. Done the Windows Update thing. Now installing my dev kit. Boy does VC6 install fast on new machines ;)…

Why do I do that

| 3 Comments
One of the good things about working on a code base of questionable quality is that you get a chance to review the way you work as well as they way the original authors worked. It's my job is to improve the quality of the code and the existing code is so different to how I would have structured it that I find myself questioning the way that I do things. Is my way better or just different? I find that I'm always analysing my actions, so here's a bit of why do I code like that analysis... Join in…

Bluetooth blues

| 4 Comments
Obviously been one of those days... I was woken before 7 this morning as Miche rushed back to work - always a bad sign when people take a wash bag with them; she's still not home... :( I was going to go back to sleep, but, well, I was awake and thought that perhaps I'd have a doze later. No such luck...…

MSDN Subscription blues

| 0 Comments
and reds and blacks and greens and, well, you get the idea. Every month when I get a shipment of disks I feel stupid. I just don't get the way the MSDN Universal Sub is organised. I'd like a little hint card in each shipment that tells me what disks I should have in the wallet for a 'full set' of 'up to date' disks... The colours and numbers and dates and all that is probably really clever but I just don't get it.…

Clean shutdown

| 2 Comments
No more zone just yet, wine's just made me blabby. The testing I've just been doing with my server is real black box stuff. The build process fires off a script that kicks off the server and then runs the test harness which connects to the server and does "good stuff", on lots of threads, until it's done. The script then runs a server shutdown app which asks the server to clean up and go away and, well, it does. When you're doing the consultant thing in banks and the like it's strange how many servers you find that are…

The slacking worked

| 0 Comments
Had one of those days where I couldn't get started. I guess it was probably something to do with the beer last night. It was Darren's birthday and we went to Namco on the South Bank and played on the arcade machines, drank beer, drove Dogems and generally acted Darren's age ;) Since I couldn't get going with what I was supposed to do today I sorted out the next socket server release and did the Windows Update dance with all of my boxes. As Paul Graham says, sometimes it's useful to keep some boring routine work around for times…

Developer buy in

| 2 Comments
The refactoring project rolls on and the code gets better. This week saw a marked change in attitute from some of the developers on the team...…

VS.Net 2003

| 0 Comments
Why oh why couldn't the new VS.Net solution file format have either been compatible with VS.Net 2002 or have a different file extension...…

I'm an exception, let me out of here...

| 0 Comments
We're adding some new functionality to the refactoring project. Unfortunately the new functionality is located in the Heart of Darkness - the most twisty and poorly structured code in the whole system. Today I stumbled onto something truly awful. Exceptions used as glorified gotos within a 350 line function...…

A coming together...

| 0 Comments
A good week for the refactoring project. The release procedures that are now in place mean that we've been able to react quickly to new functionality requests whilst continuing the new development efforts. Ah the wonders of a source control system being used properly...…

Stage complete. Time bonus...

| 0 Comments
This morning I wasted some time tracking down bugs in the multi-threaded online game engine that I'm writing for a client. Now I have tests. Tests are good.…

Infect me

| 0 Comments
I'm not test infected yet. I'm almost there. I want to be there. But I'm not there yet.…

You don't want to do it like that....

| 0 Comments
During some simple refactoring today, a phase of 'restricting access to data members', I discovered an interesting little design 'descision'. In the spirit of completely mixing up the business logic and the display logic we have a data member that represents a colour that an object uses as its background colour when it is displayed in a grid. The colour is set depending on the state of the object; error, ok, new, complete, etc. This wouldn't be too much of an issue but it's also used to test for the object state. We have lines of code that do things…

Requirements overload

| 0 Comments
Today -1 Week: Them: So, here's what we need by 9th June. Us: Ok, we can just about do that... Today: Them: Oh, add all of these things and put most of the things we asked for last week way down the list. Can you still do it by the 9th?…

We came. We saw. We did a little testing.

| 0 Comments
Another week another release. Well, almost. The plan was to release today. The plan ignored the fact that most of the team are at a wedding this weekend and nobody was around today and nobody's around on Monday...…

One step closer to sanity

| 0 Comments
Now that the refactoring project has tests it's worth having a daily build so that it's easy to spot if someone checks something in that breaks a test.…

Our first test

| 0 Comments
The refactoring project reached an exciting new stage on Friday. We were finally able to refactor some code to the point where several classes could be extracted from the application project and built in a library that the application then linked to. This required that we reduce the coupling of the classes and increase the cohesion. Once these classes were extracted we were able to set up a test harness project and write our first test case!…

Can Do considered harmful

| 0 Comments
I come from a family of pessimists, but I think I got off lightly... I'm just slightly on the 'doom and gloom' side of centre. I expect this probably accounts for my attitude to risk. I assume bad things will happen. I want to know what the worst case scenario is. I ask difficult questions in meetings. Just be thankful that you don't end up in a meeting room discussing your project with my sister...…

Scribbly pen

| 1 Comment
I think best when I can scribble. When designing software I always draw boxes and lines. These diagrams give me an anchor to come back to if I get distracted. They get binned once they're no longer needed. Pen and paper is the only way I do this, Visio is great for after the fact diagrams, but it's too slow to catch the thought process. To be able to keep up with my thinking I need a pen that scribbles well. My current favorite is the Pilot G2 with a 0.7mm tip. Just thought I'd share that ;)…

Just in time requirements

| 0 Comments
I'm currently developing an online game for a client using The Server Framework. I didn't realise that it was an online game when they originally contracted me. It's become a useful example of emergent requirements. Each time I think the project is complete they come back to me and say "and now we want you to quote for doing X"...…

Refactoring project: Joel Test, reprise

| 0 Comments
Last week we were a 5.5, now we're an 8. Not bad progress, but there's still a long way to go until the project can get a 'SaneMark'...…

Dawn of the dead

| 0 Comments
One of the problems with the code base that we're refactoring is that it's full of dead code. This week we dealt with it...…

On Cringely On Refactoring

| 0 Comments
Bob Cringely has been upsetting some programmers with his comments on refactoring. Initially, he had this to say: "Cleaning up code" is a terrible thing. Redesigning WORKING code into different WORKING code (also known as refactoring) is terrible. The reason is that once you touch WORKING code, it becomes NON-WORKING code, and the changes you make (once you get it working again) will never be known. It is basically a programmer's ego trip and nothing else. Cleaning up code, which generally does not occur in nature, is a prime example of amateur Open Source software. He then followed it up…

The Joel Test

| 0 Comments
Joel Spolsky has a quick test to rate how good your software development process is. I thought it would be useful to see how the refactoring project scores.…

Little and often

| 0 Comments
The XP folks talk about the importance of making frequent small releases. This method has advantages over and above the obvious ones; not only do you get regular feedback from real users, you also get regular practice at doing a release...…

Understanding bad code

| 0 Comments
I always used to think that there was probably a good reason behind things I didn't understand. Now I'm far quicker at deciding that the reason is that the person who created the thing didn't understand either.…

Death by debug trace

| 0 Comments
In Asserts Redux Dan Dunham and Scott Shumaker are discussing how sometimes testers have to be able to work around assertion failures and how allowing them to do so dilutes the power of the assertions. The discussion moves on to how debug traces can get out of hand and eventually you drown in debug spew.…

The importance of keeping the metaphor pure

| 0 Comments
Kent Beck and the XP guys have a lot to say about the 'the system metaphor'. In XP the metaphor replaces what most other methodologies call 'the architecture'. It's a single, coherent, view of the system. It gives you a single story from which to choose the names of things in the system. It helps you communicate about the system in a consistent language that even your users can understand. Refactoring code to keep true to the metaphor is as important as refactoring to remove bad smells.…

Smart cards in Russia

| 0 Comments
In February 1995 I flew to Perm in eastern Russia as part of a two-man team installing a smartcard system for a local bank. I was responsible for designing and implementing the card production system that was being used. For a marketing view of the system that we installed, visit Interlink's Smart Bank pages. For a personal view, stay tuned...…
« ENet | Geek Speak Archives | General »

About this Archive

This page is an archive of all entries in the Geek Speak category.

ENet is the previous category.

General is the next category.

I usually write about C++ development on Windows platforms, but I often ramble on about other less technical stuff...

Find recent content on the main index or look in the archives to find all content.

I have other blogs...

Subscribe to feed The Server Framework - high performance server development
Subscribe to feed Lock Explorer - deadlock detection and multi-threaded performance tools
Subscribe to feed l'Hexapod - embedded electronics and robotics
Subscribe to feed MegèveSki - skiing