TapDaily Bread

21 Nov 2008 12:23 by Rick

Bread is not what it used to be; or, more particularly, supermarket bread is not the same as was made in the village bakery. This is the claim of many whole-food and healthy living advocates. The common test quoted is to squeeze a small piece of bread between the fingers. factory bread will squash into a glutinous ball and “real” bread will crumble.

I can remember when I was young that it was “steam baking” that was blamed. The implication was that the steam got into the bread and made it soggy. This is rubbish of course. Steam ovens were as dry as any other sort, they just used super-heated steam in pipes to heat them. There would undoubtedly be a difference from an open flame gas oven but not from electric heating.

More recently the Chorleywood manufacturing process (PDF) is blamed. This was invented in 1961 and was rapidly adopted by all large scale manufacturers as it dramatically reduces the production time. Yet an academic report in 1966 (Chamberlain, et. al. PDF) concluded that there was very little nutritional difference in results from previous methods, thought it should be noted that it was comparing against a previous industrial process.

So what goes into bread? The basic ingredients are flour, mostly wheat (100 units), water (55-60 units by weight), yeast (1-2 units) and salt (1-2 units). This doesn’t vary much whether made industrially or domestically. There may be small amounts of other ingredients, fat/oil (1 unit) is used to soften the bread. Acetic acid (vinegar) can be used as a preservative. Commercial bread also includes some proprietary additives which include fungicides (to stop mould) and emulsifiers.

Some additives are out of the control of the bread makers—flour has to contain certain minerals and vitamins by law and these have to be boosted with flour improvers if not naturally present, which is always the case except for wholemeal flour. This is also true for flour bought for home baking, whatever the source.

So what difference does the Chorleywood process make. It uses about double the yeast because it has to act faster. It uses hard (hydrogenated or fractionated) fat which is high in chloresterol and a very small amount of Ascorbic acid (Vitamin C) is added to aid the release of gluten. The speed of the process may also retain a higher moisture content before baking but it won’t be huge. I suspect that any other differences when compared to artisan bread are more down to the quality of the flour and industrialisation rather than the process.

TapParsing XML with PHP

17 Nov 2008 19:55 by Rick

Following on from the last.fm saga described earlier, I went on to look at the method user.GetWeeklyAlbumChart which requires accessing user.GetWeeklyChartList first.

I am using the plugin iLast.Fm from Leandro Alonso and the code he is using looks right but doesn’t seem to work. He uses curl to get the XML from the last.fm site. The XML you get is of the form

<lfm status="ok">
<weeklychartlist user="[username]">
<chart from="1225022400" to="1225627200"/>
<chart from="1225627200" to="1226232000"/>
<chart from="1226232000" to="1226836800"/>
</weeklychartlist>
</lfm>

He then parses it with simplexml_load_file() and puts it into an object called $chart. Then the code processes this as follows

$chartopt = sizeof($chart->weeklychartlist->chart) - 1;
$chart = $chart->weeklychartlist->chart[$chartopt];

and uses $chart['from'] and $chart['to'] in the call to user.GetWeeklyAlbumChart.

The problem is that $chartopt always has the value 0 which means that the sizeof() function is not working properly. There is a comment on the PHP documenattion page which says that foreach doesn’t work but reccomends count/sizeof() instead. What can be wrong?

Update: The answer seems to be here: SimpleXML is not so simple and it doesn’t behave correctly. It needs

$chartopt = -1;
foreach($chart->weeklychartlist->chart as $i) $chartopt++;

TapAre you being served?

16 Nov 2008 08:20 by Rick

Whilst buying a mattress yesterday, we were chatting to the assistant and realised how many of the old independent department stores had vanished from Bristol since we have been here. These are the ones that I can remember…

  • Jolly’s on Whiteladies Road—I don’t remember using this one much and it closed soon after we came here. Part of the premises is now occupied by Maskreys furniture shop.
  • Taylors on Queens Road—A smaller one. I think it was taken over by Debenhams who soon closed it. Habitat who were on the Triangle moved here and it is still going.
  • Maggs on Queens Road—This one was a little down market and we used it a lot. Members of the family used to be prominent on the city council but it virtually closed in the late ’70s just leaving a basement hardware store and then even that went. Now there are a row of separate shops.
  • Next door was Brights, the posh neighbour—We used this one quite a bit as well and there was a hotel behind, run by the same family, which parents used when coming up for graduation. It closed or was taken over (I am not sure which) by Dingles, a branch of House of Fraser. They did an huge refit, gutting the insides and rebuilding. There was a terrific fuss when they changed the frontage and added funny little cupola arches. Later they dropped the independent name and finally moved out. Now there is a branch of Borders and some smaller shops on the ground floor but I have no idea what is in the extensive space above.
  • Lewis’s on the Horsefair—they had their own bank in the shop which, by the time we knew it, was a subsidiary of Lloyds but retained it’s identity. This was a true city centre department store over 6 floors with a restaurant on the mezzanine. It was taken over/replaced by John Lewis, no previous connection but confusing, before they moved out of town to Cribbs Causeway. Then it was empty for a bit before being taken on by Bentalls of Reading for a short while until House of Fraser moved from Queens Road. Recently they moved on to the brand new Cabot Circus so now it is empty again.
  • Next door was and still there is the national chain store, Debenhams.

So now there is only Gardiner Haskins, which is connected to Gardiners of Cirencester and Haskins of Shepton Mallet. It is a sprawling ramshackle place off the beaten track behind Old Market. It always looks like it can’t survive the year out but somehow keeps going. It is staffed by the old school assistants who are also ramshackle and off the track just like Grace Brothers and you keep expecting John Inman to pop up behind a sofa and say “Are you being served, sir?

TapLast.fm API

12 Nov 2008 22:20 by Rick

Having tried some calls to the Last.fm API, I am wondering if some of the calls are flawed or if there is something wrong with my account.

You access the data using the address http://ws.audioscrobbler.com/2.0/? and supplying certain parameters separated by &.

Two are required with all calls…
method=<the data table you want>
api_key=<a hex key which you sign up for>
and other parameters for the data table requested.

I am looking at the method user.getTopAlbums which requires…
user=<username>
period=<overall|3month|6month|12month>

This seems to work fine for period=overall returning a list of albums in descending order of number of tracks played but if I use, say, period=3month then I get a very short list of albums with a playcount of just 1. The same happens for the other periods and also user.getTopArtists.

I have only been signed up for a few weeks so I would have expected to get the same list—or is it that it doesn’t like so little data? Update: looking at the results carefully, I think it has got stuck at the first tracks I listened to on the system when I was trying it out. Could it be some sort of cache stuck somewhere? It can’t be on my system as it does the same from wherever I look.

What I would really like is user.getRecentAlbums but that one doesn’t exist. If I use user.getRecentTracks then, because we play whole albums at a time, the list gets flooded with tracks from the same album. You can probably see the effect towards the bottom of the sidebar, unless I have found a way to fix it.

TapLimit of understanding

10 Nov 2008 14:23 by Rick

If
Limit 1
then why isn’t
Limit 2
?

Thanks to a comment on Lifehacker for the idea.

TapThe perils of Welsh

3 Nov 2008 11:08 by Rick

This came from the BBC but pointed out to me by Fred Langa.

Welsh roadsign
I could just leave it there but those not speaking Welsh would never get the joke. What the second part actually says is…

I am not in the office at the moment. Please send any work to be translated.

TapHaywire

2 Nov 2008 22:04 by Rick

Friday I left work a bit early hoping to get down to Cornwall in good time. Just as I left the car park I stalled. Well perhaps I didn’t give it quite enough welly but no matter—but it wouldn’t start again.

The AARemoving and replacing the key, everything went haywire; warning lights flashing and flickering, relays clicking and dials jumping and showing random values. Oh help, this looks expensive, but I have to get away so ring the AA.

After only 45 minutes, during which I ring home and explain, a yellow van arrives. The AA man tries it, and thinks, and scratches his head and thinks that perhaps the battery is flat. A meter only shows about 10 volts so out come the jump leads. No luck, it just seems to be soaking it up and losing it. So he suggests trying a new battery—Bingo.

What seems to have happened is that a cell has shorted internally and 10v is just not enough to run the electronics, let along start the car. So, new battery paid for, I am off on my way and only about an hour late.

Thanks very nice man.

TapLast resort

31 Oct 2008 09:13 by Rick

Last.fm play-listYesterday saw a fantastic (free) upgrade to the Sonos music system. They have significantly improved the internet radio support and added support for podcasts and last.fm, the first free music service for the UK.

I can say that now because I now know what last.fm is. But this rant is about what led up to my confidence. It is strange how so many internet services are so poor at drawing in new users. Last.fm is a case in point. The upgrade to the Sonos system came in automatically with some brief notes and it said last.fm now available. So? What’s that? It looked like a web address so I typed it into Firefox. Try it! What do you get? I found something that looked like a record store or the Amazon front page. So I looked around for some sort of indication of what it was, how it worked and what you could use it for. Nothing. At the bottom is a list of links called “Learn about us” and, skipping the job adverts and media stuff there is the “About us” link. There I found some features but nothing really basic for a newcomer.

Now, to be fair, the release notes for the Sonos upgrade announced

More free music: Last.fm is free on Sonos

Last.fm is a global music service that lets you play, share and discover new music. You can also create personal radio stations based on your musical tastes. With Sonos v2.7 you can play all your stations all over the house – free of charge and free of computers.

which told me roughly what I needed to know and I had come across Pandora before, but why couldn’t Last.fm do that for itself.

My point is that we hear about all sorts of things in daily conversation and in the news—just passing references to things that the speaker assumes the listener understands. That is inevitable, but if I want to find out what it is all about and if I should take notice then I would expect to go to the supplier and find out. They are doing themselves a great disservice by not engaging with these potential new customers. The same is true of the social networking sites—if you didn’t know what they were about and you went to the front page of, say, facebook, would you really be any the wiser?

I subscribe to the feed of Daring Fireball (see, I have just done it to you if you don’t know what RSS feeds are) because John Gruber links to interesting new developments in the Apple world, but when you use the feed you don’t get his introductions. Some of them leave me completely puzzled about what they are or do. Try Cruz for example.

Eventually I found a description by Which? consumer magazine—now that is just what I always wanted (subtle reference to last night’s concert.)

TapBible Sunday

26 Oct 2008 11:13 by Rick

It is not the parts of the Bible that I understand that trouble me, it is the parts that I don’t understand.

Mark Twain, paraphrased from memory.

Earth and Heaven will pass away, but the Word of God is eternal.

Apparently written on the last standing wall of the headquarters of the Bible Society in Warsaw, one of the few remaining parts of the central city still standing after it was razed in the second world war.

TapWordPress Event Plugins

23 Oct 2008 13:45 by Rick

Looking for plugins for WordPress (or probably any other package) is very frustrating. First you have to search the directory (which, I agree, is a big improvement on what it used to be) and sift out the possible from the unlikely. Then look at the descriptions, which are often completely inadequate, and test the promising candidates.

Upcoming ServicesI have been looking for an Event system for the church web site—one that allows you to post-date items and list upcoming events, particularly services. There are a number based around iCal and Google Calendar but I didn’t want to get into that level of complexity and, anyway, a calendar based presentation is not as direct and immediate we wanted. Eventually I narrowed it down to two: WP Events and RS Event. Another one which looks promising (but complex) is Events Category but I haven’t had time to look at it [Update below].

WP-Events

Pro—Actively maintained and developed by the author (Arnan de Gans).
Supports start and end dates and times, multi- and all-day events.
Provides sidebar widget and main page hooks for upcoming events and archives plus function calls for experts.
Allows different categories for events.
Incorporates Event Location. This is not something that we would use, preferring to put this sort of information into the description.
The dedicated admin page (Manage Events) has full information about each item.
Allows HTML tags in sidebar for images and markup.
Very flexible configuration.
Simple implementation so easy to hack.

Con—Uses a separate database table for events so they are not found by the search engine.
Excerpting is done by character count rather than word which can break HTML.
Non-standard interface for creating events which is not foolproof for the non-geek e.g. no implicit tags and validation.
Events cannot be in more than one category and they bear no relation to WP post categories.
There is no single event display without creating a separate WP post and linking to it.
The More link appears even if there is no more.

RS-Event

Pro—Uses extra metadata on standard posts to indicate start date/time. Hence search and ordinary posts listings work.
Provides sidebar widget and function call for experts.
Allows different (standard WP post) categories for events.
Events can be put into multiple categories
Very easy to use, suitable for admin staff.
Simple implementation so easy to hack.

Con—the author (Robert Sargant) has vanished so it is no longer supported, though a working version patched for current WordPress can be found at LivingOS. A hacked version exists with some extra features by Nudnik.
Uses standard (rather inflexible) WP excerpting which doesn’t allow markup.
You can’t tell from the admin pages (Manage Posts) the date of each event.
There is no recording of end date/times so no concept of an event duration or multi- and all-day events.
Non-widget configuration has to be done by editing the theme files making the theme site specific (because it refers to categories explicitly by ID).
Requires an unpublished hack to get event date/time to appear in archives, search listings and single post pages.
The More link appears even if there is no more.

I have included both in my demonstrator so the user can choose. I think they will go for the second as it is easier for them to use—the extra work has already been put in my me.

[Update 24 Oct 2008]

Events Category

Something that has saved a great deal of effort is that the author of Events Category (Weston Ruter) has provided an excellent write-up. Reading this I can at least superficially evaluate it without having to download and test it.

Pro—The aforementioned write-up and I think it is maintained though there is a suggestion that it does not work with WordPress 2.5+.
Uses extra metadata on standard posts. Hence search and ordinary posts listings work. In addition, the output method uses the WordPress loop with additional template tags so customising it is flexible and straight forward.
Supports start and end dates and times and hence Multi-day events.
Events can be put into multiple categories
Allows multiple sidebar widgets and plenty of scope for theme writers.
The start date of an event is easy to see from the Manage Posts admin panel (because it is the post date).
Easy to use, suitable for admin staff.
Incorporates a comprehensive Event Location and integrates with various calendar systems.

Con—The start date of an event uses a forward dated post which loses some information, though the update tracking in current WordPress provides this information for audit.
Looking at the (well described) method of operation it is probably fairly complex, modifying deep parts of WordPress, and hence hard to hack. I am not sure I could get it to work with current WP.

From that analysis I don’t think we will be using it but there are some great ideas there that I may adapt for use with whichever system we do go with. One thing the exercise has demonstrated is how many different ways you can use to achieve the same objective.

^ Top