SHA-256 is a cryptographic hash function developed by the US. National Security Agency (NSA) as a U.S. Federal Information Processing Standard (FIPS). The SHA acronym stands for Secure Hash Algorithm. A hash function operates on an arbitrary amount of data and returns a fixed-size bit string, the cryptographic hash value.
So why would such an algorithm be useful? Its utility lies in the fact that attempts to change the original data will almost certainly change the hash value returned by the algorithm. An obvious application would be to apply such an algorithm to a file (text or binary) as a means of determining whether or not it has been tampered with.
This post shows you how to use SHA-256 as implemented by the OpenSSL open source project, and use it within Windows / Visual C++ environments to produce digital signatures of strings or files.
Continue reading ‘Installing and using OpenSSL SHA-256 in Visual C++’ »
A short and to-the-point C++ recipe for determining the status of your PC / laptop DVD.
To study this area in more depth, follow this link for more information, which is where I got much of this inspiration for this code snippet. It works.
Full code listing
Continue reading ‘Reading the status of DVD drives in C++’ »
Suppose you wish to implement a silent installation of audio and video codecs for windows. It may be that you wish to execute this as a pre-requisite for a main application you are installing, while avoiding dialog windows or command prompts from appearing while it is doing this. Hence the use of so-called ‘silent’ or ‘unattended’ installations. This post shows you how to create a silent installation of K-Lite audio/video codecs.
Continue reading ‘Creating silent installs of audio and video codecs using K-Lite’ »
As stated on the boost.org Getting Started for Windows page, most Boost libraries are header-based that require no no separate building. But there exist some Boost libraries that require a separate compilation in order to use them. This page essentially reiterates what is already explained in section 5.2.1 of the Getting Started page, but with additional screenshots to make it easier for newcomers.
A previous post dealt with the separate compilation of Boost library binaries using BoostPro, but this package is no longer supported, alas.
Continue reading ‘How to use the Boost compiled libraries in Windows’ »
Given a directed or undirected graph, determine whether it is connected or not. Specifically is it possible for any pair of nodes to communicate with each other?
This brief post reproduces this web page whereby the problem was to determine whether a graph is strongly connected or not. I use a slight modification of
Graph so that the user can define whether the graph consists of directed or undirected edges. When setting the directed parameter to false, the
Graph class assumes that the edges are undirected, and so adds an additional link in the opposite direction to maintain bi-connectivity between edges (links).
Continue reading ‘Using depth first search to test graph connectivity in C++’ »
The flow deviation algorithm as developed by Leonard Kleinrock et al is an efficient means of assigning routes and flows for a given network topology so as to minimize the overall average delay. The problem consists of finding a set of routes for all communicating end nodes which minimize the delay without violating link capacity constraints. The Flow Deviation method works in a manner very similar to gradient methods for functions with continuous variables, whereby the concept of using gradients is replaced by the concept of “shortest path” flows.
Continue reading ‘Implementing the Flow Deviation Algorithm in C++’ »
A sample demonstration of using the Boost libraries as a means of finding matching words in a large array table, that match the given lookup criteria.
Suppose you are wrestling with a cryptic crossword and want to find all seven-letter words whose third letter is ‘Y’ and fifth letter is ‘N’, or better still, run a program that will find these words for you.
Continue reading ‘Using Boost regular expressions as word finders’ »
Some hints and tips on how to overcome an annoying little gotcha that causes the Linux-based NetBeans IDE to freeze when trying to create a new project:
Instead of presenting the user with the options for creating a new project as shown in the screenshot below, the screen remains stuck with the egg timer, and does not allow the user to proceed:
Continue reading ‘When the NetBeans IDE cannot start a new project’ »
To merge changes made in your branched project back into the trunk (re-integrate).
For branching in TortoiseSVN see this previous post.
So you’ve now made some changes to your branched project that have been debugged, tested, reviewed etc and checked in. Given that you and your team are happy with the branched changes, you now wish to re-integrate them back into your trunk.
Continue reading ‘How to Merge using TortoiseSVN’ »
When using Subversion / TortoiseSVN I tend to use the ‘conventional’ repository layout by adding branches/tags/trunk directories to the root: (Please click on any images shown here to enlarge.)
Continue reading ‘How to Branch using Tortoise SVN’ »