Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, February 07, 2008

CVS to Mercurial

This week I finally tried out Mercurial.
Having used only CVS before, I found this VCS simply amazing.
It's really simple to use and also to learn. Useless to say I decided
to move all my projects from CVS to mercurial.

After searching a while on the net I found some alternatives:
Mercurial ConvertExtension is shipped with mercurial 0.95 so I decided to
use this but probably Tailor is the most flexible of all. Surely it deserve
a try.

Anyhow, the documentation on the ConvertExtension wiki page is just non
existent and the online help of mercurial does not helped me a lot.

So here's how to convert a CVS module:

First of all checkout the module you want to convert as usual.
Let's say myproject is the checked out module, then do the following in
the directory containing the module:

$ hg convert myproject/
assuming destination myproject-hg
initializing destination myproject-hg repository
connecting to :ext:user@cvs.example.com:/cvsroot
scanning source...
sorting...
converting...


Now mercurial convert CVS commits to changesets and in the end it creates
a .hgtags file containing the mapping between CVS releases and mercurial
changesets.

Here it is. Now your module is ready to be used with mercurial. Just to see
if all is ok:
$ cd myproject-hg
$ hg log
And you should see all you CVS history.

Tuesday, February 05, 2008

Send MMS

Some months ago I've had to write a simple software for sending MMS. Before that moment, my knowledge of MMS or WAP was very limited. Indeed my mobile phone do not even supports MMS... (or color to be honest).

So I've start to search the internet for some documentation regarding MMS and how to send them through a GPRS connection. Unfortunately there's not so much documentation on these matters. In the end I figured out that I could use jWAP to send the binary MMS message to the MMSC of the provider. The last problem was how to build a binary MMS. The only Java library I found capable of encoding a binary MMS was "MMS Java Library" from Nokia. The first problem with this libarry was the download (for some reason, it's not downloadable from the Nokia web site anymore and I had to search for it a lot to find a copy). The second problem was the license that wasn't so clear (the only thing I found it's a post on the Nokia forum where it's said you cand modify if freely).

So after all I decided it was a better idea to write a simple library to encode MMS messages. Fortunately the specification avaiable at Open Mobile Alliance are quite detailed. The only problematic thing is to find the informations you need in all those pdf files.

In the end the results of this work are avaiable here. You'll find the library for encoding and decoding MMS and a simple client to send them trough a WAP gateway. At the moment the library is quite simple, it supports encoding of send_req messages and decoding of send_conf ones only. Also it does supports only image and text parts. In the future it's possible that new features will be added.

Anyway if someone is searching information on how to send MMS take a look at the sources of SendMMS (a total of 3 classes with one being an Exception and one a container).
If you want details on how to encode a MMS message take a look at the sources of jMmsLib, they are quite simple to read and understand.