A Developer's Diary

Aug 31, 2010

zthreads - building zthread dll using visual studio 2008

ZThreads is a cross platform object oriented library written in C++ which provides a clean and simple interface to both POSIX threads and Windows API threads.

Building ZThread shared library using Visual Studio 2008

1. Download ZThread source tar ball and extract it.
2. Create a new Win32Project using the Visual Studio installed templates
3. Go to Application Settings of Win32 Application Wizard
4. Select dll as the Application type and Empty project in the Additional options.
5. Add all the cxx files inside ZThread src folder into your project Source Files excluding the sub directories
6. Go to C/C++ tab in the Project Properties. Specify ZThread include directory in the Additional Include Directories
7. Change the default Character Set used by your Visual Studio project from Use Unicode Character Set to Not Set
8. Build the project

Read more ...

Aug 29, 2010

Mercurial - A short tutorial

Why Mercurial?

Mercurial can boast of really unique set of properties that make it a particular good choice as a distributed revision control system.
1. Easy to learn and safe to use
2. Lightweight
3. Delightful extensions and customization
4. Scalable
Download and install the Windows shell extension for Mercurial (TortoiseHg) from here

Creating a Repository

hg init main
where
main is the repository name

Mercurial reads configuration data from several files, if they exist. On Windows, it normally looks for %USERPROFILE%/mercurial.ini file or %USERPROFILE%/.hgrc file and in Unix based machines it looks for $HOME/.hgrc file. For detailed information type hg help config in the command line window or the terminal
Configuring Mercurial

Open %USERPROFILE%/mercurial.ini or %USERPROFILE%/.hgrc file and add following lines to it.

[ui]
username = Firstname Lastname <firstname.lastname@example.net>

This sets the username for the mercurial and this information is for reading by other users

Mercurial has inbuilt lightweight HTTP server that can be used to share the repository.
Serving the Repository

hg serve -p 80 -d
where
-p is used to specify a different port (default port 8000)
-d is used to run the server in the background

Creating a local copy of the Repository

hg clone http://host-name/
This creates a clone of the repository on the local machine

Read more ...