A brief and hopefully to the point on getting up and running with OpenGL in an Ubuntu Linux environment. For setting up OpenGL in Windows / Visual Studio environments, please see this post. My choice of integrated development environment for C++ development for this example is Netbeans 7.3. Continue reading
Author Archives: happyuk
Practical examples of using Boost serialization
Listing1: Serialization of STL containers: a std::vector example using text archives
Your intuition may tell you to iterate through the STL container in order to serialize it, but it’s actually a lot simpler. First of all, be sure to include the necessary vector.hpp include file:
Continue reading
Getting started with SWiG for interfacing between C# and C++ Visual Studio projects
1. Download and extract the SWiG interface:
Windows version available here:
http://prdownloads.sourceforge.net/swig/swigwin-2.0.9.zip
Using RSA to encrypt large data files in C#
Introduction
A utility in C# to use public/private key encryption of data inside large text files, before sending them over a secure connection such as SSL. Symmetric encryption, whereby both recipient and sender (or client and server) know the key with which to encrypt and decrypt messages was out of the question due to it’s inherent that use this key.
Continue reading
Using Win32 static libraries in Visual Studio projects
A static library is simply a file that contains functionality that can be made available to other programs. Static libraries end with the .lib extension and are made available to other Visual Studio projects (console applications, MFC applications etc) by creating links to them. Please follow the steps described below in order to create and use your own static libraries.
Continue reading
How to recursively print STL-based trees
There are plenty of resources on how we may recursively search and print the contents of binary trees. This example shows how to (recursively) make use of the Boost serialization libraries and streams in order to print the contents of a tree-like data structure.
Continue reading
Using BoostPro to install Boost library packages
A number of Windows-based Boost libraries are not “header-only” and require that you must get them compiled. One way is to compile them yourself. A possibly easier way is to do this via the prebuilt installer packages from BoostPro.
Say for example you wish to use the Boost serialize facilities in your program:
Continue reading
How to link DLLs to C++ Projects
These instructions, also available on the Microsoft site, show how to create from scratch a Visual Studio 2010 project that can utilize dll routines created elsewhere, by way of referencing. It basically says the same thing, but with additional screenshots to make it more intuitive.
Continue reading
Using stateful functors
For another example posts on functors (function objects) see here. A functor is an instance of a C++ class that has the operator() defined. One big advantage of functors is that when you define the operator() in C++ classes you not only get objects that can act like functions, but can also store state as well.
Continue reading
Using boost::bind to assign functions
Some code samples I have collated in the sample below, that demonstrate how boost::function can be assigned with functors, ordinary functions, class member functions and overloaded class member functions respectively.
Continue reading