Saturday, March 22, 2008

merging from an unrelated bzr project.

After converting my old svn repositories to bzr, I was left with a few other projects that had been in bzr all along that I wanted to integrate into the larger bzr collection. In this e-mail thread in one of the bzr mailing lists. I found a technique for doing this.

It says:

Currently, the way to do it is to set the base to 0 explicitly. E.g.
"bzr merge -r 0..-1 OTHER_BRANCH".


I'm such a bzr novice that I don't even know for sure exactly what this means but it seemed to work.

Friday, March 21, 2008

migration to bzr

For several years now, I've been using svn for VC on my personal files. When I upgraded my server to ubuntu gutsy, I started running into some trouble with svn. I could read repositories but was getting database errors when I tried to write to them. Rather than try to figure this out, it seemed like a good time to switch to bzr.

This ended up working pretty well. I used svn2bzr.py to convert the svn repos to bzr and now remote access works with bzr+ssh. I created a bzr user to manage the repos. At first I forgot to change the repository ownership to bzr so I had some permission problems but these went away upon correctly setting the ownership.

I ended up upgrading my server bzr version from 0.9.0 to 1.2 which seemed to make things run smoother. I'm not sure whether or not the problems that I was seeing were related to the permissions issue or the version though. On windows, I'm currently running 1.3

I still need to do a checksum on binary files to make sure that they came through the transition ok but so far everything seems fine.

Incidentally, I'm also using a root level bzr repo on the server to track changes to config files. So far so good.

Wednesday, March 19, 2008

installing ubuntu 7.10 ( gutsy) over the network

I have a machine that I've been using as a server for a couple of years. Unfortunately, it has a broken cdrom drive which means that I can't easily reinstall a new operating system. I *could* bite the bullet and get a new cdrom but I have not done this because it needs a laptop drive and I don't want to pay the extra expense, I'm a little concerned about compatibility and I am not sure how much trouble it is to swap out the drive.

In any case, this machine has been long overdue for a os upgrade. I have been running some old version of ubuntu (hoary?) and I wanted to start from scratch with gutsy. The important data is on a couple of partitions that I can leave untouched and I had some free space on the drive.

My first thought was to copy an iso to a usb key but this did not work because, to my surprise, the machine does not have a way to boot from usb.

So, I fell back on installing from the network. For several years now I've done this with varying degrees of success using this page as a reference.... and I'm happy to say it worked today.

However, it took me a couple of times to get it to work. I think I might have downloaded the wrong linux/initrd.gz/default files the first time around. It took me a few tries to figure out how to specify the paths to the files in the menu.lst file for grub (it ended up being by full pathname). It was essential to specify a desktop environment to install - I used vanilla ubuntu - without that things just didn't seem to work at all. I had to specify /dev/sda to install grub onto the mbr instead of /dev/hda like the example said.

All that is behind me now and things seem to be working just fine!

Sunday, March 16, 2008

git vs bzr - further impressions

I find myself leaning towards bzr. I've been using git for a while now and the commands just seem less intuitive. For example. git-checkout with no arguments tells what items are deleted from a repository but git-checkout with an argument restores the argument if it is deleted. I'm not sure what git-checkout with an existing argument does.

Thursday, March 13, 2008

bzr-svn

Somehow I got the idea that it would be cool to be able to checkout a sourceforge project using the bzr-svn plugin. It turns out that this plugin requires an old version of bzr (1.1) and an unreleased version of svn (1.5) or later. I don't mind the old version of bzr but I don't want to take the time to build the new svn so this will have to wait. Maybe I'll try git-svn .

Monday, March 10, 2008

windows permissions problem (solved)

Yesterday I discovered that users other than myself could not install new software on a shared computer. This was due to not being able to access the "Program Files" folder. The other users all had administrator status but that did not seem to be enough.

It turns out that there is a level of control in windows that only shows up when in safe mode (!). For some reason, only I had full access to the "Program Files" . After booting in safe mode I was able to add full control for the administrators group and this took care of the problem.

Without being in safe mode, I couldn't even diagnose the problem since user/group access settings were not visible. Is there a program that will let me view/edit these settings in normal mode?

I also am curious as to what program changed these settings? Perhaps coLinux/andLinux since these packages have to do some things at a pretty low level and they have the option for file sharing between linux/windows - that's just a guess though.

Wednesday, March 5, 2008

on second thought

On second thought another way to handle the c++ -> calc connection would be to use swig to enable python to call c++. This way the spreadsheet could be used to handle both input and output. So... the next experiment is to call python functionality from inside of calc.

And it turns out it's easy. Just put the python program into:
c:/Documents and Settings/dave/Application Data/OpenOffice.org2/user/Scripts/python
and it is available as a macro. Need to play with this a little to see if it really suits my needs.

Still need to see if I can get swig to work with the python that comes with open office.

This may be a problem. The swig documentation implies that you need version compatibility between the python executable and the swig code for swig to work.

Yes this is a problem. I can't yet even compile the swig examples because the python included with open office is not a complete developement environment. Or at least I can't find the Python.h include file needed to compile the swig examples.

c++ to python communication

My next mini project is to get a c++ program talking to a python program. My expectation is that the solution for this problem will be a networked solution. I want it to be portable of course.

The first candidate is xml-rpc. I've used this in the past with c++ to c++ communication but it was some work to make the implementation that I was using work under windows so I will look for other clients. I'm not sure what I have in the way of alternatives in python but porting should not be an issue there.

After looking around a little at xml-rpc alternatives I found xml-rpc++ ( in sourceforge ) which looks like it might be a better option. The demo is easy to build and seems to work. This is only c++ to c++ code so I need to look into what is needed to make python work as a server.

And it works! Using xml-rpc++ as client and the built in xmlrpc python server I have the two programs talking!

Tuesday, March 4, 2008

open office spreadsheet scripting

I would like to be able to use output from a program to control an open office spreadsheet. Ideally this solution should work in both windows and linux. This blog entry is a record of my experiences.

Posted a how to question to the open office forum. Got a number of "yes it can be done" responses and some links to reference sites.

The available options seem to be c++, python, java, and beanshell ( a java scripting ) language. I'm going to try c++ first, then python, then beanshell, then java.

Tried c++. Started by downloading the open office sdk. It does not seem very well configured for windows. There are no include files but there are .idl files that are used to create include files. The tool for doing this is an executable called cppumaker and is available but it's not clear how to use it. It's invoked through the makefile which does not work on cygwin. I'm going to look for some cppumaker documentation but not for too long.

Found documentation for cppumaker but it's not easy to follow. On to python.

Python is a winner. Open office has a built in python and I found this article that tells how to interface to open office. The article uses open office writer for its example but I expect that the techniques will be easily adaptable to calc.

Monday, March 3, 2008

colinux / andLinux - followup

It looks like colinux and/or andlinux is not quite there yet. The functionality is nice but does not always seem to start reliably and also has a hard time shutting down. I'll wait until the next beta release and hope for better.

Sunday, March 2, 2008

git - first thoughts

Similar to bzr/hg. Unlike bzr but like hg appears not to treat directories as entities unto themselves. Seems strange to have to add changes to a file that is already in the database.

colinux / andLinux

I just installed andLinux ( a derivative of colinux ) on my windows machine. This looks like the best windows / linux interoperability solution I have seen so far. I can install native linux apps using apt-get and run them almost seamlessly.