ODB is an open-source, cross-platform, and cross-database object-relational mapping (ORM) system for C++. It allows you to persist C++ objects to a relational database without having to deal with tables, columns, or SQL and without manually writing any mapping code. ODB supports MySQL, SQLite, PostgreSQL, Oracle, and Microsoft SQL Server relational databases as well Read More →

The following macro is not quite as compact as a single-use ostringstream or boost::lexical_cast.
But if you need conversion-to-string repeatedly in your code, this macro is more elegant in use than directly handling stringstreams or explicit casting every time.
It is also very versatile, as it converts everything supported by operator <<(), even in combination.

#include <sstream>
#define SSTR( Read More →

This is a very basic MySQL++ program and it’s very self explanatory:

#include <mysql++.h>
#include <stdlib.h>

using namespace std;
using namespace mysqlpp;

int main() {
try {
Connection conn(false);
conn.connect("DB NAME", "DB HOST probably localhost", "DB USER", "DB PASS");
Read More →

Because we are trying to illustrate MySQL and mSQL database access, we will focus on issues specific to MySQL and mSQL and not try to create the perfect general C++ API. In the MySQL and mSQL world, there are three basic concepts: the connection, the result set, and the rows in the result set. Read More →

The current Matlab release, R2012b, only supports GCC 4.4 for compiling MEX functions on Linux.
On compute nodes, the installed GCC may be too old, but compiling a new version is not that hard.
The following script works for me on a Red Hat Enterprise Linux 5 machine. Note that these instructions build GCC with shared Read More →

I discovered the Red Hat DevTools 1.1 for CentOS-5/6 ×86_64 and updated GCC tools on my CentOS 6.4 build machine from gcc version 4.4.7 to 4.7.
The devtools work great! I wished I had discovered them sooner. They use Software Collections (SCLs) that install all the tools under /opt directory without polluting any of the existing Read More →

C++ is a bunch of small additions to C, with a few major additions. One major addition is the object-oriented approach (the other addition is support for generic programming, which we'll cover later). As the name object-oriented programming suggests, this approach deals with objects. Of course, these are not real-life objects themselves. Instead, these objects Read More →

Before discussing classes, this lesson will be an introduction to data structures similar to classes. Structures are a way of storing many different values in variables of potentially different types under the same name. This makes it a more modular program, which is easier to modify because its design makes things more compact. Structs are Read More →

A debugging tool to debug errors in C and C++ programs. A debugger is the best friend of a software programmer.This tutorial assumes you already know how to program in C and C++ and you can compile and execute programs.
GNU Debugger which is called gdb is the most popular debugger for UNIX systems to debug Read More →