Saturday, December 15, 2012

Building on Windoze with boost

Just recently I tried to build an app on Windoze that uses boost. I got an error at linktime to do with a missing symbol from boost. It was for system_category() in the boost system library. I eventually tracked down the cause, which is very non-obvious. It is to do with 32 bit versus 64 bit building. I am using Windoze 7, 64 bit. The problem was caused by the way I was using jam to do the boost build. The command line to use is:

bjam toolset=msvc-10.0 variant=release threading=multi link=static
--address-model=64 --build-type=complete --with-system

In particular, note that
you must say --address-model=64. the -- is very important. Some other reports of this issue on the web say that you have to say address-model=64.

Sunday, November 04, 2012

Grid computing and high availability

One of the things I found out when working on a grid system is that Murphy's Law works overtime there. In fact I would go as far as to say that on a grid "even if nothing can go wrong then it will". So, for the next time, if ever, that I find myself working on a grid system, I will probably want to refer to this article about HA-OSCAR that I found in The Linux Journal.

Capturing a wiki

Trawling through my notes and ancient reminders to myself on this wet Sunday morning, I am reminded to publish a link I found in the Linux Journal. It is a very useful article on how to capture a wiki using wget.

Saturday, November 03, 2012

Prettyprinting C++ code

After all these decades, there is still I need for prettyprinters. I am in shock. I was spoilt in java-land, where eclipse takes care of this for you. In C++ it's a different story.

I have to say that these days most C++ is formatted OK. Enough years have gone by that most people recognise that making the source readable to humans is important enough for it to be worth that little bit of extra effort. Sadly, not everyone is enlightened so poorly formatted C++ code is still being written today. C++ IDEs that take care of this issue are not universally used. IDEs themselves are still a bit of an issue since there is no multi-platform IDE that most C++ people can agree on. Eclipse CDT isn't there yet and in my opinion is several years away. So the question is, what to do?

I have given up on GNU indent. It was meant for C anyway rather than C++ so it can easily get confused and do the wrong thing when presented with C++. The GNU project had an appeal a few years ago for a new maintainer, but no-one stepped up to the plate. The project languishes in obscurity now. However, there is a new program called astyle, which stands for Artistic Style. I have been using this recently and find it to be OK; not brilliant but OK. So this is what I will use for now. I think it could do with some of the options/features that GNU indent has but beggars can't be choosers.

A while ago, when I was still in java-land, I thought that the eclipse formatter plugin might be used. It certainly works very well for java. There is a blog entry about this that discusses running the eclipse plugin from the command line for C++ code.

Java: separating unit tests from integration tests

I have been going through some old notes of mine and came across a link to a very informative blog about how to keep unit tests and integration tests separate when using maven. The link is Enjoy...

Monday, October 29, 2012

Downloading large files on Windoze

Many websites that contain large files to download warn Windoze users that under Windoze the download may get silently truncated. I have seen these warnings often but paid no attention to them because I always assumed it was only users of Internet Exploiter that were vunerable. Well I was wrong. I got nobbled by this problem today using Firefox. I was trying to download a debian DVD image at 4.4GB. It downloaded 980MB and stopped. Grr!

I thought, oh well, I will just have to use wget. And then the trouble started. I was in a corporate environment so there was a proxy. It is possible to configure wget with a proxy but you do need to know the proxy details. They can be viewed from the control panel but then you can get a nasty problem. The information is shown in a non-resizeable window (duh!). So the proxy information I was after was clipped, due to the URL being quite long. I found that to get the value in a normal resizeable window you have to look it up in the registry. The key is Computer\KEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL. Armed with this information I set the environment variable http_proxy (lowercase) to the value and ran wget. It worked like a dream.

I think I must be the only person in the world who thinks that windows with variable content must always be resizeable. As far as I can see, all GUI environments seem to encourage people to create non-resizeable windows. I think MicrosoftWindows makes more use of them than any other GUI environment though. Other GUIs sometimes copy windows so these GUIs are also increasing the number of non-resizeable windows. Deep sigh.

Wednesday, October 10, 2012

When is a scrum not a scrum?

As the craze to claim that a project is agile gathers pace, I see more cases where the daily meeting is referred to as a scrum. Gimme a break. See this article at the Agile Forest, for what is wrong with the trend in status meetings.
Quoting from the article:

The key purpose of a Stand-up is the opportunity to collaborate, share and support each other in the delivery of valuable outcomes.

I reckon that over time we will all see more and more examples of where the language of agile is adopted without the actual corresponding practice. There will be talk of sprints, iterations, retrospectives, scrums, kanbans, etc etc whilst the waterfall approach continues to be used on the project as the actual main method. Of course this means the project will not be able to embrace change since it will not be able to move quickly and easily in any direction. But then no-one will see anything wrong with that because waterfall is always the way it has been done. And a slow, plodding speed of delivery with document+design,code,test,signoff in strict order with no feedback will continue to be the way that software development is expected to be done.

At the next "scrum" I am tempted to ask who is the scrum master. But I have a feeling that the irony will be lost: I will just be told it is the person that asks each person in turn, "what did you do yesterday, what will you do today?" whilst the rest of team waits for the meeting to finish.

Wednesday, July 11, 2012

Migrating my web hosting

I have been with FastHosts for years but this was because they were (relatively) cheap and UK-based. However, I have just moved to BlueHost, which (IMHO) is far far better.

Switching over

FastHosts has been ok but they do not (at the time of writing this) provide any Postgres facility. Databases are MySQL only. I actually want/need both. I use MySQL for Coppermine, but would like to use Postgres for DSpace. There are not many UK-based providers that have the Postgres option. The option is much more common with US hosting companies.

There is another reason for preferring my hosting to be done outside Europe. A new stupid law has been passed that forces web sites to declare if they use cookies. Yeah, right. Problem solved. My website is now outside Europe.

I did a bit of research and found that BlueHost has everything and is reasonably priced. I moved my website over and had a few slight technical issues at first. I used their online 24/7 technical help and found it to be excellent and free of charge. It is also available 24/7. Most UK support is only in office hours Monday to Friday and you have to pay for it via expensive phone calls with lengthly waiting times and obnoxious musak.

BlueHost do not allow a domain to be transferred to them. However, they can still host such domains. I found this a bit confusing at first. Domain registration is handled by certain official bodies across the world. In the UK a common organisation that does this is called Nominet. Web hosting providers that offer to handle your domain registration do so by dealing with Nominet. BlueHost do not deal with Nominet since Nominet is for the UK. However, that doesn't matter. What matters is how requests that are aimed at your domain get directed to the appropriate IP address. This is done using nameservers. When Fasthosts first set up my domain they configured my domain to use their own nameservers. But their webpages have configuration that allows this to be changed for when you wish to change who is hosting your domain. I changed them and in less than 12 hours my web site had changed over. Marvellous!

Migrating Coppermine

I hit a few snags when migrating my photos over to BlueHost. I use Coppermine to manage my photos, so I got the latest version, installed it on my own machine, set up a MySQL database and Apache with PHP, and started up the Coppermine landing page to verify that it would work properly.

When you land on a Coppermine home page for the first time, the PHP starts to configure your environment. It did this for me on my own machine (eventually) so I reasoned that the time was right for me to FTP all the files to my BlueHost area and it should work in just the same way. It didn't. It gave a weird PHP scripting error. Googling for the error message gave hits that made me think the problem was to do with the use of SSI (Server Side Includes). However, with some help from BlueHost support it was determined that the problem was to do with file permissions. Once the folders were set to 0755 and the files were set to 0644 all was well.

Wednesday, June 27, 2012

Getting a TV card working with Debian

I made the mistake of buying a card without first checking that it would work with linux. How foolish. I was forced to replace it. I now have a DVICO FusionHDTV DVB-T Dual Digital 4. I updated my system to Debian Wheezy (testing), 64 bit.

dmesg reveals the error:

[ 1501.907761] xc2028 1-0061: Error: firmware xc3028-v27.fw not found.

this problem is described at
However, those instructions assume 32 bit. I am on 64 bit.

there seems to be a problem getting hold of the the firmware file.
I registered on and searched for firmware file. There is a post that has the file as an attachment.

I unpacked it and copied it to /lib/firmware.

Then I rebooted. The dmesg error went away.

I used the scan command to find the channels:

scan -u /usr/share/dvb/dvb-t/uk-CrystalPalace >channel.conf

I then gave the command:

cp channels.conf /etc && cp channels.conf ~/.tzap

The command:

tzap -c /etc/channels.conf -r 'BBC ONE'

is interesting. It produced the following over and over again.

status 1e | signal c024 | snr fdfd | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1e | signal c008 | snr fefe | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1e | signal c014 | snr fefe | ber 00000000 | unc 00000000 | FE_HAS_LOCK

It is as if something else had the tuner resource.
However, as it turns out, this is what it is supposed to do. Starting another terminal session whilst tzap is still running enables me to give the command:

mplayer /dev/dvb/adapter0/dvr0 which now works!

So I now have TV working on my debian machine. All I need now is to get a PVR environment working. I will have a go with either Freevo or MythTV.