Feb 142014
 

I have published my very first project on GitHub: Allocator Builder

From the summary:

A highly composable, policy based C++ allocator based on ideas from Andrei Alexandrescu, presented at the C++ and Beyond 2013 seminar.

The background behind the idea is to compensate the main problem of ::malloc() and the other standard allocators, the separation of memory pointer and the allocated size. This makes it very difficult for all kind of allocators to handle in a fast way memory allocations and deallocations.

 

Sep 212013
 

During the last weeks I spend some time in optimizing a C++ string class that we use in our application. You may ask, why one should spend time today in writing ones own string class. There are already so many available for C++ like std::string and QString.

Many years ago we decided to implement because of different reasons our own string class in C++. One reason was that we have to handle very often UIDs in our domain – medical applications. They have a maximum length of 64 chars.  The Visual Studio’s STL implementation is highly optimized for strings with a max length of 16 bytes. So we decided that our class should have a chunk of 128 bytes to avoid unnecessary additional heap allocations.

Continue reading »

Sep 202013
 

During the development in TDD manner of some generic C++ code in our project I stumbled over the problem that I wanted to forbid the usage of integral, floating point and pointer types as a certain template argument. Only types with a default constructor made sense in that context. My very first attempt was to use a static_assert like:

I checked inside my file with the unit test, that the instantiation of Foo<int>() actually led to a compile time error. So fine so good. I made an #if 0 … #endif around this sample failure code and went on.

Later a colleague of mine reviewed the code and brought up the point, that a) this is not a real unit test and b) whenever someone changes the file containing the definition of Foo<> he has no knowledge about the commented code in the unit test file. He was right! But how to ensure that on one hand something does not compile and on the other hand how to guarantee that the unit test fails if the tested code gets changed in the future, e.g. during a refactoring? It seems to be a paradox. One could move this failure detection from compile time to runtime. But this would worse than the static_assert, because the advantage of early feedback to the developer would be gone. So I kept the compile time check.

Continue reading »

Dec 202011
 

The deepest impact on my side was studying the following books during the last year: Continuous Integration by Paul M. Duvall, Steve Matyas and Andrew Glover and Continuous Delivery by Jez Humble and David Farley. These books and presentations during the OOP 2011 in Munique pushed me into the direction that I am trying to describe below.

Before I go into details how we use Cucumber, I want to describe a little bit our environment: In our company we are developing a medical application that can run as a standalone application or in a client / server setup. Each configuration consists for the user of three UI processes and about fifteen background processes or services. The data persistence is realized with a PostgreSQL database, which is handled through one of the service processes. It is a radiological reviewing workstation that is highly optimized on high volume throughput. The image data for each patient can easily be about 2.5 GB and the technical challenge is to display any of next possible radiological images, which can have easily 26-50MB each in less than a second, because our customers are used to diagnose about 60-120 cases per hour. Depending of the current workflow step, the user has to work with a different UI process.

The application has about 2,000,000 lines of C++ code, currently about 10.000 single requirements and most of the functional tests are manual paper based or steered by our test management system SpiraTest. So it is obvious that we have plenty of work to do. Beside the fact that we have way too much requirements or be more precise that the granularity of the requirements is too fine, certain parts of the code are hardly testable in an automated way. Our transition from the V-model to SCRUM two years ago brought up dramatically the fact that test automation is one important step for us to stay productive and ensure quality.

Continue reading »

Mar 092011
 

On January, the 30th 2011 the composer John Barry died at the age of 76 years.

As great fan of his music and as a tribute to his works I present here an article I found many years ago in Film Score Monthly (#74, October 1996):

The 1996 Cinemusic Award was presented to John Barry by his old chum, Michael Cain. The following is Mr. Cain’s brief but touching speech at the second cinemusic Award Gala Night held on 9 March 1996. Mr. Cain flew to Gstaad direct from a four month shoot in Miami just for this event:

If you’re a lucky actor, you make your first film. And if you’re very, very lucky, you get great composer to write it. I was very lucky. I made a film called Zulu, and the music was brilliant and helped to make the film a success.

If you’re a slightly older actor, and you ‘re very, very, very lucky, you get to star in a movie. And if you’re very lucky, you get a great composer, which was John Barry, and the film was The Ipcress File, and when suddenly things don’t go right, and you have nowhere to live, he puts you up in his flat for eight weeks. And that’s John Barry.

Kooking back on it, the thought of having me as a house guest for eight weeks must have been an absolute nightmare. But for me, the first night was a nightmare. I’d just gone to bed. We’d been out to dinner, John and I and whoever – we were single at the time, both of us – I’d just gone to bed, and the piano started. It was one o’clock in the morning, and the piano kept on all night, and it just kept going, and I thought “To hell with this! I’ve got to find somewhere else to live.” You know, you hear about these musical geniuses who sit up all night writing, and that’s how John was.

At seven o’clock in the morning, I staggered out. I couldn’t sleep, so I decided to get up. And just sitting there, sweat pouring off him, much thinner than he is now, he [John] really reminded me of Franz Liszt. I said to him, “What the hell were you doing all night?” And he said, “I’ve written this song.” And I said, “What’s it called?” And he said “Goldfinger.” And so I was the first person ever in the world to hear “Goldfinger,” and ever to see how John Barry works.

Once, I went to a rough cut of a Bond film, without the music on it, and I sat there. It’s a unique experience to see a Bond film without any music. And at the end of the film, I sat there and thought, “That’s the end of the series. It stinks. It’ useless.” And I hadn’t even realized there was no music in it – I just watched it. And then, of course, John puts the music on, and it works. If you could ever see some of those great movies that you’ve seen without music on them, you’d think to yourself, “How the hell does anybody ever think they’d be a success? It’s rubbish.” I’m not saying that Bonds are rubbish; they’re quite well-made films.What I’m trying to say is that the importance of music on a film is quite extraordinary.

Think back on all the hit movies that you can think of. Practically every single one will have some song or a piece of music associated with it. I just want to point out the importance of the film composer. When I finish a film, the last thing I say to the director with my dying breath at the end of the picture party is, “And who is going to write the music?” And if he’ll say “My sister-in-law,” I know we’re dead.

The importance of music, especially to someone like me, who has no real musical talent whatsoever. But I adore music, and I adore film music, and the importance of music in films – and the importance of this festival – which is concentrated on this really important side as film music, is really incredible.

The reason I’m here not just because I’m great friends with John Barry, which of course I am, and have been for a long, long period of time… It’s because I think that John Barry is one of the greatest movie composers in the history of the movies. I just got off a plane from Miami… I wasn’t about to arrive here and give an award to someone who I didn’t think was great, I’ll tell you that!

The problem with John is that John is very retiring, very quiet, very shy. He’s not a gib man, and so when you see him, he doesn’t sort of look great, so if’re not very careful, you may miss the fact that you’re in the presence of a probable genius, and I don’t want you to do that, because I’m going to invite him up here not to take this award. This is probably the first time in the history of awards that the award is heavier that the person receiving it.

Ladies and gentlemen, don’t be fooled, this is a great, great man – John Barry.