How to use Boost library with Eclipse on Ubuntu

I was trying to use the multi-threading capability of boost C++ library, but found that there is no comprehensive(and appropriately brief) guide which shows how to use this library with Eclipse on Ubuntu, so I decided to write one myself.

Boost is a set of widely used cross platform C++ libraries which provide a lot of functionalities which are required by most of medium-large sized applications like multi-threading and regular expressions, but unfortunately are not available natively in C++(although some of these will be available in C++11).
This guide believes that you already have downloaded, installed and setup Eclipse for C++ in your computer(if not, download from here).

1.) Download the latest version(1.48.0 at the time of this writing) of boost library from here. Download boost_version.tar.bz2 file.
2.)Execute the following command in the directory where you want to put boost installation:-
tar –bzip2 -xf /[path_to_tar]/boost_1_48_0.tar.bz2
For example, if you stored “boost_1_48_0.tar.bz2” in “/media/Data/downloads” and want to put the installation in “/media/Installation” then go to “/media/installation” and execute:-
tar –bzip2 -xf /media/Data/downloads/boost_1_48_0.tar.bz2

Continue reading “How to use Boost library with Eclipse on Ubuntu”

How to use Hibernate 4 with MySQL

Hibernate is an ORM (Object-Relation Mapping) tool for Java. It is used to persist and fetch data in the database via mapping the software objects to the relational model where properties of a class are mapped to a column in a table, class or an entity is mapped to table and instance of a class is a new record in a table.

This document explains the process of creating a simple Java application which uses Hibernate version 4, to store and retrieve data from MySQL database. It also explains how to create a simple MySQL  DB using XAMPP.

It is believed that the reader has a general idea of Eclipse IDE and Java.

Installing XAMPP and starting MySQL

There are various ways in which MySQL can be installed locally, namely:

I prefer using XAMPP, because it installs many other things like myPhpAdmin, Apache, FileZila, etc. and it’s free!!

Continue reading “How to use Hibernate 4 with MySQL”