Steve's weblog


Archive for the 'General stuff' Category

Extracting random elements from an array with php  0

Cat.: General stuff
08. July 2011

Steve Frost (@stevefrost) asked about the speed difference between two different code approaches in php to extract 10 random elements from an array.

Being a bit of a number cruncher, this felt like a nice challenge. So I wrote a ruby class (so much nicer than php :-) ) to take a command line script and run it 25 times and record how long each run took. This gave me the ability to gather one sample so this was wrapped with a script that ran the two different code snippets with increasing array sizes and voila;
Relative performance of shuffle vs random

This clearly shows that the use of shuffle is much slower as the size of the array increases – indeed it would appear to be an exponential curve as opposed to a linear relationship.

I should look at adding in some statistical tests to my test harness – but that will be another day!

Sustainable transport a la pyrenees  0

Cat.: General stuff
16. September 2010

On a walk up to a mountain hut I wondered how they got all the food / beer / wine up there. First thought was a helicopter but I wondered if they were old school and used mules.

So imagine my suprise when I saw this at the hut!

A few pictures of the workshop  0

Cat.: General stuff
13. September 2010

It seems an earlier post has gone walkabout ….

So a few pictures of the workshop. It is basically a timber frame building with straw bale Walls and lime render inside and out.

The timber frame uses the Segal method of framing. I had planned to add side supports rather than use plywood sheeting on the inside as the sheeting would have made making the Walls a bit difficult. The site slopes a lot with a 6 foot drop at one end. Instead I am going to use se plywood sheeting coupled with corner bracing to add se extra sheer strength. The lime render has made a big difference bit I do not want to rely on it.

Making use of windfalls  0

Cat.: General stuff
09. September 2010

We had a massive rain storm a couple of days ago and one of our nice eating apple trees lost about a third of the apples. Not quite ripe but pretty much there. They would not store and there are only so many apples you can eat so what to do?

Well I have a Finnish steamer which seems to be designed for such an event. Full it with water and apples (washed and halved) and then just steam away for an hour or so. What you end up with is a sweet apple juice. I tend to put most of the juice into sterile bottles and then heat in a water bath and it will keep for a good 6 months.

The photos show the steamer – the top is where the apples go (second picture) .

Highland expo  4

Cat.: General stuff
16. August 2010

Last week I went up to Scotland for a week and I managed to get to the Highland housing expo (bit.ly/cUEkhl).

The expo is set up as a showcase for green building in Scotland. It was going to happen last year but the credit crunch delayed everything and resulted in the houses being smaller than originally planned.

The expo is well worth going to – just to see where current thinking is on house builds. I was dissapointed with many of the buildings – the credit crunch meant that few houses had solar panels or water harvesting for example. But it was great to see some good ideas and things I would want to avoid. Before the visit I would have not thought much about open vs closed stairs for example.

I came away with the thought that when I get my eco house designed I will want to focus the architect on all the features I want. It seems even green architects do not always push the envelope!

I did not get around all the houses – there are 50 there!

First Holds  0

Cat.: General stuff
06. May 2006

For the past few months I have been working on a series of photographs based at a local crag – “Black Rocks”. A gritstone crag with a long history of climbing, it has many challenging routes and a number of classic routes.

In an exploratory mode, I wanted to look at how details of the crag could describe the place as well, or better than a classic “wide angle” shot. At one visit I met up with two climbers who were attempting to climb Demon Rib and it struck me that the focus of attention is on the crux of the climb. This is usually well off the ground and it made me think that you rarely think about the first move off the ground. You just start climbing and start really concentrating on the flow of moves as you get off the ground.

So I started taking shots of the first holds on the climbs at Black Rocks. In my edition of the guide there are 67 routes! I have now got photos of most of the climbs and I am in the process of getting down to a gallery of 12 shots. They may not be the hardest climbs …