Posts

Changing the font size of the 'Syntaxhighlighter' plugin

Image
Alex Gorbatchev's Syntaxhighlighter is a GREAT plugin for posting code samples on your website. I know because I use it on here. My only minor gripe was in the default size of the actual font itself - it was too large for my own preference. Modifying the size is simple, and I'm going to post it here for future reference.

Windows programming using MinGW

Image
A short example of how to started with Windows programming in non-Visual Studio environments. In this example, we use the MinGW (Minimalist GNU for Windows) compiler within the Code::Blocks integrated development environment. MinGW can be obtained via the following link: http://www.mingw.org/ First select File > New > Project... and opt to create a new empty project:

Creating and avoiding deadlock conditions in C++

Image
A short and to-the-point post illustrating how a deadlock situation can be created in C++, together with a possible strategy for avoiding such a condition. I'm am using the boost libraries to implement threads and mutexes, but it should be possible to the standard library implementations std::thread , std::mutex etc as well.

Using sc.exe to communicate with Windows Services in Visual C++

Image
SC.exe is commonly used to retrieve and set control information about installed Windows services. Common tasks are to configure, start and stop a service, as well as retrieve the status of a specific service. These tasks can be achieved by executing sc.exe inside a command prompt as a batch (.bat) files that can call combinations of sc.exe commands to automate startup or shutdown of services.

Getting started with client-server applications in C++

Image
A demonstration of simple Internet client-server applications in C++ (Linux-based). The client application tries to connect to the remote server application using the IP address of the remote server ('localhost' or 127.0.0.1) and the server port number which defaulted to 1234. The server application listens to port number 1234 for a connection request. When the server application receives the connection request it sends the text message "Hello!\r\n" to the client.

Configuring Code::Blocks to use OpenCV in Linux Environments

Image
A quick guide to setting up and installing OpenCV for using in the Code::Blocks integrated development environment in Linux. The version of Linux I am currently using is Ubuntu 14.04. At the time of writing the version of OpenCV for Linux used is 2.4.9. (I had originally tried version 2.4.10 but had problems compiling it with the version of gcc I had (4.8.2), so I reverted to 2.4.9 instead.)

Configuring Code::Blocks to use the Boost Libraries in Windows and Linux

Image
Some examples of how to configure Code::Blocks to use the Boost C++ libraries: 1. Header-only (Windows) 2. Compiled libraries (Windows) 3. Compiled libraries (Ubuntu Linux) 1. Header-only (Windows) To configure Code::Blocks to use a header-only Boost library: Boost.DateTime. Select File > New > Project > Empty Project: