Category Archives: C++

Semi-Stable Partition

Inspiration Alexander Stepanov and Paul McJones in the their book “Elements of Programming” (Chaper 11.1) describe a stable partition algorithm that appears to be more complex than necessary. Here I present an improvement. Problem Definition A partition of sequence with … Continue reading

Posted in Algorithm, C++ | Leave a comment

String Matching Algorithms

Simple algorithms for searching permutations and combinations in strings Continue reading

Posted in Algorithm, C++ | Leave a comment

On Computing the Fibonacci Number in O(log(n))

Introduction Liu Feng posted a number of Lisp functions to compute a Fibonacci number with O(log(n)) time complexity where n is the n-th number to be computed. The last such function involved tail recursion. While the function is correct there … Continue reading

Posted in Algorithm, C++ | 4 Comments

Unit Testing With Boost in Visual Studio

The Problem There are many Unit Testing Frameworks (UTF) for C++. Wikipedia list over 50 of them. Not all of them are created equal. CPPUnit is one of the oldest and is still popular. Google Test has a strong brand … Continue reading

Posted in C++, Software Engineering, Windows | Tagged | 5 Comments

Asio: A Brief Introduction for the Windows Programmer

Really! Yet another tutorial on Asio? “Why?” The average C++ programmer has much more experience than say the average Java/Javscript programmer – not necessarily a good thing. (C++ is becoming like assembler.) As such a C++ developer can understand how … Continue reading

Posted in C++, Concurrent Programming, Software Engineering | Tagged , , | Leave a comment

Web Server Using C++ – Asio

Motivation There are good web servers both in the free/open source arena as well as commercial products. Apache and Lighttp are widely used in the UN*X based systems. PHP, Python based Django or Ruby on Rails usually run on top … Continue reading

Posted in C++, Software Engineering | Leave a comment

C++ Multithreading: Promise and Future

Introduction In addition to providing portable wrappers for native multi-threading facilities, C++ also provides higher level constructs that allow the programmer to call functions asynchronously. Future Consider: Here f is of type future<int>. The async function may be computed in … Continue reading

Posted in C++, Concurrent Programming, Software Engineering | Tagged | Leave a comment