Posts from October 2006

Grancrete

GrancreteThanks to Dale Grover for pointing me at this article about Grancrete, a new type of spray-on concrete replacement which the developers claim could transform house-building in the developing world.

To build a house, you construct it out of polystyrene panels, cut holes where you want doors and windows, and then spray the panels, both inside and out, with Grancrete. The mixture is about 50% sand, 25% ash, and 25% their special binding compound. A few hours later, the house is usable, and the foam core of the walls makes for good insulation.

More info on the Grancrete site, especially the video page.

Clockwork Orange?

TangerineHere's a neat little free Mac app that's getting some attention: Tangerine.

It analyses the music in your iTunes library and works out the BPM (beats per minute) of each track. It's in beta at present, but works really quite well. There are multiple uses, but I guess the chief benefit will be for those who like to exercise to music and want to jog at a consistent speed!

I could use it to discover that the people running twice as fast as me are only doing so because they're listening to Hall & Oates' Maneater (179bpm) while I struggle along with Dylan's One More Night (89bpm).

Of course, if you're creating playlists of songs that blend into each other, you can juxtapose songs with a x2 speed multiple and they work rather well...

Making out?

Warning - geeky post ahead... I've been doing some coding this week...

Anyone who's done any programming, at least if it's outside the limited confines of an integrated development environment, will have come across the make utility, which was developed nearly 30 years ago at Bell Labs.

Make lets you list which bits of a program depend on which other bits, so that when you make a change, say, to one of your source code files, you can just type 'make' and the bits which need to be updated as a result all get rebuilt automatically.

People use it for other things, too; many years ago I had to produce Rose's PhD thesis through a rather complicated process which started with floppies from a dedicated Panasonic wordprocessor, ran through a C program I wrote to decode the disk format, a Perl script to convert the files to LaTeX, and then Latex itself and finally dvi2ps to get the Postscript output for printing! Each stage generated different files, updated tables of contents etc, and when she fixed a typo on her Panasonic, I needed to ensure that it was propagated through the entire pipeline and made it into print. Make was good for that.

But anyone who's built a project of any size will also know that make is far from perfect. It really hasn't evolved much in its thirty years and the syntax, while elegant for very small projects, becomes unintelligible for large ones.

Here's a small segment of a Makefile I was writing last week:

define PROGRAM_template
$(1): $$($(patsubst %,%_OBJS, $(notdir $(1)))) \\
        $$($(patsubst %,%_LIBS, $(notdir $(1))))
     g++ -o  $$@ $$^ $$($(patsubst %,%_LDFLAGS, $(notdir $(1)))) $(LDFLAGS)
all:: $(1)
$(foreach obj, $($(notdir $(1)_OBJS)), \\
     $(eval $(call OBJECT_template, $(obj),$(notdir $(1)) )) )
endef

# Build every program defined in PROGS
$(foreach prog,$(PROGS),$(eval $(call PROGRAM_template, $(prog))))
Don't bother trying to understand this. The point is that it's pretty arcane stuff and I wasn't trying to do anything too sophisticated here. If you've written Makefiles before you probably know roughly what's going on, but do you know exactly what's going on? Would you have got the right number of $ signs in the right places? Could you say why $$^ is in here and not $$< ? Why I have to call things and then eval them? Then try and imagine what it's like for somebody seeing a Makefile for the first time! And here's the worst bit: for this to work at all, the gap at the beginning of the 'g++' line must be a tab, not spaces. So simple code that looks perfectly correct may not actually work when you try to run it. It's a nightmare. So last week I decided that using make in the 21st century was probably ridiculous, and it was time to search for alternatives. An IDE like Visual Studio, XCode or Eclipse will often handle dependencies for you, of course, but even if everybody in your organisation can be persuaded to use the same one, it's not a solution for cross-platform work or when you need to distribute code to others who may not have the same tools. There are a huge number of alternatives to make out there; the ant tool is popular with Java programmers, for example, but I wanted a more general solution. And after reading many articles detailing others' experiences and recommendations, I opted to experiment with scons. And I'm loving it. Scons is normally taken to be short for 'software construct', though the name didn't quite evolve from that origin. But while it may lose out to make in the elegance of the name, it's superior in almost every other way. Scons is written in Python, making it easy to install and run on most platforms, and easy to extend if you need new features. More importantly, the SConstruct files, the equivalent of Makefiles, are also valid Python, meaning that they're very readable, and yet you have the full power of a programming language there if you need it. And not a '$$($(patsubst %' in sight! I don't want to go into too much more detail here about its merits, but if you're dealing with make on a regular basis, you owe it to yourself to look at scons. Read 'What makes Scons better?' on the site's front page. See what some users have to say about it. And then print a copy of the documentation to read on the train home, and check out the wiki. That's my recommendation, anyway. It's true that the majority of the world uses make. It's also true that the majority of the world used to use COBOL.

Perian

Mac users should check out the Perian project.

"Perian is a free plugin that enables QuickTime to play almost every popular video format."

A nice side-effect is that it also enables Front Row to play almost every popular video format. Like the ones that typically float around in Bittorrent space...

E61

Here's a picture of my Nokia E61, for those who haven't seen them in the flesh:

Nokia E61

Unusually for devices of this shape, it's not a bad phone. The sound quality and signal strength are really pretty good.

I think I may have to reach for a J2ME programming book to see if I can fix some of the shortcomings of the built-in software...

Mobile network neutrality?

The core of the network neutrality debate is whether the people providing the 'pipes' - telecoms operators, in general - should be able to charge the big online companies, the Googles & Yahoos, for delivery of their content. If Youtube wants smooth playback of their videos on your screen, they may have to pay your broadband provider for a special quality of service.

Much of the controversy comes because this violates the 'end-to-end principle' which made the internet successful in the first place: the fact that you gave the network some data, and it did its best to deliver it, without any reference to what that data might actualy contain. Much of the innovation around the internet has only been possible because of this. Skype could not have become Skype if it had needed to ask permission from the network operators. The telecoms companies are now, partly because of the outcry, claiming that they're really talking about better delivery of new services, not about restrictions on existing ones, but many people see this as a slippery slope to a bad place.

This week's Economist has a good section on telecoms convergence, and I particularly liked this comment by Andrew Odlyzko:

The telecoms firms could even find that the boot is on the other foot, says Mr Odlyzko of the University of Minnesota. Referring to companies such as AT&T and Verizon, he asks: ""What makes them think that they are going to charge Google, as opposed to Google charging them?"" Cable companies, he points out, have to pay for the television shows and films they deliver over their networks.
It's a good point. I'm lucky in that it would be fairly easy for me to switch broadband provider, and one thing that would make me do so very quickly would be if my current provider became unable to deliver Google's services. In the mobile world, of course, changing provider can be rather easier. My new T-Mobile 3G connection, for example, allows me almost unlimited data but includes a specific clause that allows them to downgrade my data connection if the use of VOIP protocols is detected. They offer a noticeably more expensive connection that doesn't include this restriction. Interesting...

"The Device"

The DeviceThis is very cool and I wish I'd thought of it first. It will...

...keep track of several things that need metering. That includes anything from "CPU Usage" to eBay Auction Status" to our personal favorite, "The Current GDP of Uzbekistan." From what we can tell, "The Device" connects to your Windows machine (Mac / Linux support is coming soon, apparently) and displays some piece of data generated from your computer or culled from the internet.

Convergence

Well, this post comes via a 3G network, using my Nokia E61.

I'll write more about this device soon. It does so much more than my Blackberry - better sound, wifi connectivity, VOIP calls, lovely big screen and pretty decent keyboard, to name a few - but some aspects are noticeably more flaky or obscure.

I had my Blackberry up & running and doing what I wanted very quickly, whereas I've been playing with this device all weekend and still haven't quite got it as I want it. But that's partly because there is so much more you can do with this... I didn't spend much time configuring my BB to connect to my Asterisk server via wifi, for example! But the BB is basically an enhanced phone, where this is a very capable PDA, almost a tiny laptop, with a whole new operating system to learn - Symbian, in this case, which I'm much happier to have on my phone than anything from Redmond.

The main reason I wanted to try the E61 was to get 3G connectivity for my laptop, and it does that very nicely. It's also better for doing blog posts from the breakfast table! But for general ease of use, it's hard to beat a Blackberry.

Getting greener

I detect a worrying trend here.

It started when we got the 'green bin' recycling scheme, and Rose began pressuring me into recycling everything that could possibly be recycled. I grumpily acquiesced, but am now rather proud of the small amount of stuff in our non-recyclable bin when it's collected each fortnight.

Then we made a recent decision to start buying organic food when possible, despite the premium prices at Waitrose. This is the modern equivalent of tithing to the church, I guess, but we think of it as one of the little luxuries that you're allowed when you don't have children to feed as well!

And now we even have a box of local vegetables & fruit delivered by the nice people at the Cambridge Organic Food Company.

But no, I'm not about to grow a beard, and any Birkenstock representatives considering contacting me as a result of this post should think again. Sometimes, though, this green stuff provides me with an excuse to buy gadgets. Actually, almost anything provides me with an excuse to buy gadgets. That's another thing you can do when you don't have kids.

This particular toy is a sensor which clips onto the main power lead coming into my house:

Electrisave sensor

and provides a nice little wireless display telling us how many kilowatts we're currently using. Just about 1.1, at the moment:

Electrisave display

It can also tell us in pence per hour, or tonnes of greenhouse gas per year, should we so desire. It's also a temperature and humidity display. Quite sweet. It would take a long time, I think, for me to save sufficient electricity to pay for it, but every little helps... It's an Australian invention, called an Electrisave over here, and is available in the UK from their site, or, more cheaply, from British Gas.