Peter Bloomfield

A software engineering blog

  • Blog
  • About me
  • Contact me
  • Music blog
CMake

Path error when building with Conan and CMake

An autorun registry entry left behind by Conda can cause Conan/CMake builds to fail on Windows

3 min read
CMake

Workaround for nvcc pthread issue

There seems to be a bug in certain versions of CMake which cause the CUDA compiler (nvcc) to fail. Using another version of CMake resolves the problem.

1 min read
email

Importing email folders into Gmail

POP doesn't support folders. This can make it tricky if you want to migrate emails which have been organised into folders. This article outlines some possible solutions when migrating into GMail.

4 min read
python

Why Python 3 doesn't write the Unicode BOM

Python doesn't always output a Unicode Byte Order Mark. This can cause problems for programs which expect to see it. This post outlines when and why Python doesn't output the BOM, and how to fix it.

2 min read
python

Output file encoding in Python 3

How to specify which Unicode encoding to use for reading or writing text files in Python 3.

2 min read
localisation

Generate UTF-8 dictionaries using gettext

How to force the gettext tools to generate a dictionary with UTF-8 encoding, even when the original translation strings only contain ASCII.

2 min read
c++

Decimal places in a floating point number

The floating point format has variable precision depending on the number it represents. This post examines how many decimal places would fit in a floating point number, and how useful that information really is.

7 min read
batch

Emit audible warning from a batch script

How to make a Windows batch script emit an audible beep.

1 min read
c++

How to check that a function is constexpr

This post gives a simple technique to verify that a C++ function can be evaluated at compile time.

2 min read
c++

C++ constexpr functions

C++11 introduced constexpr functions which can be evaluated at compile time. This post outlines some ways of using this helpful feature.

3 min read
c++

Using C++ templates for size-based type selection

How to use std::conditional to automatically select an appropriate size of integer based on template parameters in C++.

3 min read
c++

Pure virtual final functions in C++

A quirk of C++ allows you to define a member function which can never be implemented, in a class which can never be instantiated.

1 min read
c++

Order of parameter evaluation in C++

When calling a function in C/C++, the parameters are not necessarily evaluated in the order you expect. This can lead to some tricky bugs if your code has conflicting side effects.

2 min read
c++

MFC prevents bad_alloc from being thrown

The MFC library interferes with standard behaviour of the new operator in C++. You may need to handle a different exception type to detect failed allocations.

4 min read
c++

Convert a number to a binary string (and back) in C++

How to convert numbers to and from binary strings in C++ using the bitset class.

2 min read
Windows

Changing the emulation mode of the Microsoft Web Browser ActiveX control

An ActiveX browser control may emulate IE7 by default. This behaviour can be changed using a registry key.

2 min read
Windows

NSIS Access Control problem with built-in users group

User group names on Windows Vista onwards are localised strings. When setting file permissions in an installer, you may need to use a Security Identifier instead.

2 min read
electronics

What is a serial-to-parallel shift register?

Serial-to-parallel shift registers are fairly simple components which can be helpful for increasing the number of outputs from devices like Raspberry Pi and Arduino.

7 min read
visual-studio

Automatically output the callstack on a breakpoint in Visual Studio

How to automatically output a stack trace when a C++ breakpoint is hit in Visual Studio.

2 min read
c++

Understanding C++11 move semantics

An introduction to using move operations in C++.

9 min read
c++

C++11 auto variables

An overview of the C++ auto keyword for deducing type information in variable declarations.

6 min read
c++

Improve C++ performance in debug mode with inline expansion

Debug builds of C++ programs sometimes run very slowly. This post suggests one possible technique for speeding it up.

4 min read
c++

Introduction to Win32 Named Pipes (C++)

A tutorial about using synchronous named pipes in the Win32 API to transfer data between processes.

6 min read
ms-word

Running chapter headers in Microsoft Word

A tutorial on enabling running chapter headers on large documents in Microsoft Word.

3 min read
compilers

avidscript lives!

An overview of a personal project in which I created a simple programming language and implemented a custom compiler/VM from scratch in C++.

4 min read
Peter Bloomfield © 2019
Latest Posts Twitter