I have developed a simple macro that enables Python style ‘with’ in C++.
This being said, I feel the urgent need for a short foreword…
ITS_A_MACRO. If you’re already tempted to email me about how bad an idea macros are, go ahead. I can take it. Naturally, I would prefer this to be part of the language.
- This is not about enabling Python style programming in C++, but about bringing in a nice concept from another language. Think about it: Python is very similar to C++ with respect to resource ownership and management (RAII).
The motivation are familiar bugs like these:
I just have to publicly state my complete disappointment with international politicians.
Please, could one – just one – country in this world have enough balls and grant asylum to a whistle-blower who is faced with unjust prosecution in his home country – by the way, a country where murder is a routine form of punishment?
Maybe if I told you this man made an invaluable contribution to maintaining freedom and privacy word-wide?
I recently purchased a NETGEAR ReadyNAS Duo for my small home network. Having made the experience that NETGEAR make very good hardware with not-so-good firmware and virtually nonexistent and useless documentation, I had done some prior research and had found out the ReadyNAS is essentially a debian Linux box. Since I also wanted to use the box as a print server, I had also looked for and found a hardware compatibility list that included my printer.
Appears I got my hope up too soon (see here) – more trouble was to come. Runtime errors – different from the original one – kept occuring, no matter what winetricks I applied…
Until I finally found out what had gone wrong in the first place: winetricks mfc40 (or mfc42 for that matter) failed to install oleaut32.dll for some unknown reason. After manually unpacking and registering the file, all trouble was gone.
Obviously, I would be interested in why it was possible to fix one of the many errors by just applying a different locale, but I guess I’ll stick to the old never touch a running system rule now…
I recently spent one and a half days trying to get a Windows application to run on an Arch Linux PC. The strange part: I had the application running for years without any trouble, and then…
After a wine update, I got some runtime errors. Thus, I decided to just reinstall the app – installing had always worked just fine. But no success. The runtime errors kept popping up.
OK, I thought – just go back to the previous wine version… Did that, same errors! Tried a really old version (1.2.something), same errors!
After many many attempts and many many Google searches, I found a solution by pure chance: I installed the application on a different PC, and transferred the WINEPREFIX directory – Success!
Why did this work? Well, both machines run Arch Linux, and both are up-to-date…
Turns out the only real difference was the locale setting: The machine that finally did the job uses an English user interface as opposed to a German one. Investigation showed winetricks failed to properly install one of mdac28, jet40 or mfc40 when a non-English locale was in use.