Compiling memecoin-qt on (X)Ubuntu

This is a little guide to help you compile the memecoin-qt client on (X)Ubuntu.

Since they are all based on the same client, this guide should also be applicable on other clients like the litecoin-qt, feathercoin-qt, …

1. Install git, make a ~/src directory and clone the memecoin-qt source code

mining@mining:sudo apt-get install git
mining@mining:cd ~
mining@mining:mkdir src
mining@mining:cd src
mining@mining:git clone https://github.com/muddafudda/Memecoin

2. Download the needed development files

sudo apt-get install build-essential libssl-dev \
libdb-dev libdb++-dev libboost-all-dev \
libqrencode-dev qt4-qmake libqtgui4 libqt4-dev

3. Fix memecoin-qt.pro

There is a little error in the memecoin-qt.pro file which forces make to use a very specific version of boost. Open ~/src/Memecoin/memecoin-qt.pro and change the line that says
LIBS += -lboost_system-mgw46-mt-sd-1_53 -lboost_filesystem-mgw46-mt-sd-1_53 -lboost_program_options-mgw46-mt-sd-1_53 -lboost_thread-mgw46-mt-sd-1_53
into
LIBS += -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread

BOOST_LIB_SUFFIX=-mgw46-mt-sd-1_53
should become
BOOST_LIB_SUFFIX=

and deleting the following lines

isEmpty(BOOST_LIB_SUFFIX) {
macx:BOOST_LIB_SUFFIX = -mt
windows:BOOST_LIB_SUFFIX = -mgw44-mt-s-1_53
}

should help you fix errors like:

ddatamapper.o build/moc_transactiondesc.o build/moc_transactiondescdialog.o build/moc_bitcoinamountfield.o build/moc_transactionfilterproxy.o build/moc_transactionview.o build/moc_walletmodel.o build/moc_overviewpage.o build/moc_csvmodelwriter.o build/moc_sendcoinsentry.o build/moc_qvalidatedlineedit.o build/moc_qvaluecombobox.o build/moc_askpassphrasedialog.o build/moc_notificator.o build/moc_miningpage.o build/moc_rpcconsole.o build/qrc_bitcoin.o    -L/usr/lib/i386-linux-gnu -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lrt -LC:/deps/boost/stage/lib -Lc:/deps/db/build_unix -Lc:/deps/ssl -lssl -lcrypto -ldb_cxx -lboost_system-mgw46-mt-sd-1_53 -lboost_filesystem-mgw46-mt-sd-1_53 -lboost_program_options-mgw46-mt-sd-1_53 -lboost_thread-mgw46-mt-sd-1_53 -lQtGui -lQtCore -lpthread
/usr/bin/ld: cannot find -lboost_system-mgw46-mt-sd-1_53
/usr/bin/ld: cannot find -lboost_filesystem-mgw46-mt-sd-1_53
/usr/bin/ld: cannot find -lboost_program_options-mgw46-mt-sd-1_53
/usr/bin/ld: cannot find -lboost_thread-mgw46-mt-sd-1_53
collect2: error: ld returned 1 exit status
make: *** [memecoin-qt] Error 1

4. Prepare the installation

mining@mining:cd ~/src/MemeCoin
mining@mining:qmake USE_UPNP=- USE_QRCODE=0 USE_IPV6=0

You can safely ignore following messages:
Project MESSAGE: Building without UPNP support
Project MESSAGE: Building with UPNP supportRemoved plural forms as the target language has less forms.
If this sounds wrong, possibly the target language is not set or recognized.

5. Build it

mining@mining: make

The last step might take a while, but once it’s finished, there should be an executable file called ‘memecoin-qt’ in ~/src/Memecoin/

Edit 2013-12-20: Please also check out my cryptocurrency build script which automates a few things for you on Linux.

J-ExifTool v0.0.1

Today I’ve released the first version of J-ExifTool together with its source code on BitBucket.  It’s the first version and it’s still very, very beta so I won’t guarantee that it’ll work flawlessly but if you find any bugs, please let me know and I’ll do my best to fix them :) .

The only prerequisites are that you have ExifTool by Phil Harvey installed somewhere on your computer and that you point towards it via the exiftool.path system property (as explained on the wiki) . Also, obviously, you’ll need some other dependencies which I’ve kindly put in a zip for you (there are better ways I know, but the sun is shining and I’m not in the mood to find a better way atm :-P ).

Reading and writing tags should now be as easy as

JExifTool tool = new JExifTool(); //starts exiftool process
JExifInfo info1 = tool.getInfo(new File("test-resources/read01.JPG")); // create proxy
System.out.println("ISO value is " +  info1.getTag(ExifIFD.ISO)); //execute read
System.out.println("Focal length changed to " + info1.setTag(ExifIFD.FOCALLENGTH, "5.0"));

For reference purposes only: git revision a2c4c7c5eb22 = v0.0.1 .

Unit testing your services with the help of DBUnit

Unittesting an application is something which can improve the overall quality of the application. It can sometimes be a tedious job to test a service layer which accesses a database because it has to be in a known state when running the tests. To do this, unit tests which need a database often use in-memory databases like H2 or HSQL (HyperSQL) because they run independent from other developers and force the user to initialise the database in a known state. To do this you could drop and re-create your database using SQL scripts before every test or even create a setup-script and a teardown-script  but there is much ‘nicer’ way of doing this: DBUnit

A shameless copy-paste of dbunit.org:

DbUnit is a JUnit extension (also usable with Ant) targeted at database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.

DbUnit has the ability to export and import your database data to and from XML datasets. Since version 2.0, DbUnit can also work with very large datasets when used in streaming mode. DBUnit can also help you to verify that your database data match an expected set of values.

Continue reading “Unit testing your services with the help of DBUnit”