Tuesday, May 30, 2006

Fructose

One of my favourite blogs is that of Jeff Duntemann; I first came across Jeff as a columnist in the computer magazine Dr Dobbs Journal nearly twenty years ago, and have followed his career ever since. I find his blog very interesting, as it contains a wide variety of subjects. True, I'm not normally interested in his musings on Catholicism, and sometimes his material about publishing becomes tedious, but frequently he brings up interesting issues.

His latest entry (at the time of writing) is about fructose, or rather high-fructose corn syrup. He points the interested reader to this article which contains a fairly detailed explanation of the biochemistry of fructose, which normally enters the body as a component of table sugar.

Many people don't know this, but my degree is in Food Science, which is composed of four subjects: food analysis, biochemistry, microbiology and food manufacture. I've listed the four in the order of my interest, which was not necessarily the ratio in which we were taught. I'm sure there have been vast improvements in the syllabus since I graduated 28 years ago. My dissertation was on methods of analysing xylitol in food; xylitol is a sugar alcohol (not a true sugar) which apparently has the ability to heal dental caries whilst being sweeter than fructose, which in turn is sweeter than table sugar. Not surprisingly, one of the 'foods' which I examined was chewing gum.

One of the more interesting pieces of data about xylitol was why it is so sweet. This is due to the physical layout of its hydroxyl groups and nothing to do with its chemical properties or metabolism. The xylitol molecule happens to 'sit' on the sweetness receptors in the tongue better than other sugars and thus is sweeter.

I was reminded of my xylitol research when reading the article about fructose: why is fructose metabolised only in the liver whereas glucose can be metabolised by every cell in the body? Why can fructose cause raised levels of uric acid (which can cause gout) whereas glucose does not? Why does fructose not stimulate the pancreas to produce insulin? The question which I am trying to ask is what were the carbohydrates available to the early primates and why do our genes code the ability to handle glucose one way and fructose another.

Obviously, a few million years ago, there weren't purified mono- (fructose, glucose) and disaccharides (sucrose aka table sugar, lactose aka milk sugar) available. But there were starches, and these are polysaccharides almost completely composed of glucose units. Other saccharides (like the trisaccharides in cabbage) were probably undigested as our ancestors were lacking the enzymes for their metabolism. So now that I think of it, if starch were the primary carbohydrate source, then it's not surprising that we have enzymes for its metabolism (readily available in one's saliva), it's not surprising that we are geared to deal with its metabolic product, glucose, and it's not surprising that we are less well equipped to deal with the metabolism of other sugars.

I thought that fructose was converted into glucose and then metabolised, but obviously not.

Judging by the articles that Duntemann mentions, it seems that fructose - and especially high-fructose corn syrup - is something to be avoided at all costs. Fortunately because of my dietary problems, I eat very little preprocessed food, so I hope that my fructose intake is minimal. I have enough dietary problems as it is.

Friday, May 19, 2006

Strumming the guitar - stage two

Things have been hectic at work over the past few weeks, which generally means that I don't do anything much with my 'own' time. Now that the pace has relaxed slightly, I thought it a good idea to go back to my MIDI strumming program. As it happens, it's exactly one month since I last wrote about it.

First off, I solved a few of the problems which I had left open:

  • Choosing different voicings of the same chord
  • How to represent strings which aren't played in a chord
  • Time signatures
The third problem wasn't really a problem when I thought about it: a strum's time signature is implicit in its pattern, so all I had to do was remove any code which might have attempted to affect the time signature. Obviously one is not going to use this program in order to strum along with material by National Health (or even Debussy's sublime "Afternoon of a fawn") in which time signatures change frequently.

Choosing different voicings also turned out to be much simpler than I had originally imagined: all it needed was to add a 'version' number to each chord (for example, "E minor7/1" and "E minor7/2" which will be enough to differentiate. Although one might think that there would be problems matching a chord like 'E7/9', this is not so. 

Unplayed strimgs also turned out to be a 'paper tiger': the string's value is set to 'x', and elsewhere the code knows that an 'x' note should have the MIDI value 0.

Here's a screenshot of the chord definition screen:

Once I had got all those problems out of the way, I started on the 'MIDI substitution' code. The idea here is to create a MIDI file consisting one bar of strummed E Major, and then to copy the values contained within the MIDI file into the new file, where the notes of E Major are substituted by the notes in the chosen chord. Whilst this wasn't easy to do, it also wasn't as hard as I had expected. The code uses procedural variables which simplify matters. In the great tradition of information hiding, the calling program sends a chord shape to a routine called 'WriteChord'. without knowing how that routine is actually implemented. The user is presented with several strum patterns, and after a pattern has been chosen, the 'WriteChord' procedural variable is set to the corresponding procedure for the chosen pattern.

The first pattern which I used with the substitution algorithm didn't finish correctly, so I had to edit some of the final delta times in order to get the timing correct. The second pattern which I tried came out correctly.

Now all that's left to do is enter more patterns, which is very much grunt work. There may still be a problem with time signatures - these are coded somewhere in a MIDI file's prologue, and of course at the moment I'm using a 4/4 signature. I imagine that this will be resolved by a flag being set if a specific pattern is in 3/4 (or even 5/4, gasp); prior to writing the file, the signature bytes in the prologue will be modified to the correct value.

I've decided to punt on the issue of chords changing halfway though a bar. The user can manually edit the resulting MIDI file.

Monday, May 01, 2006

The dream is over

As John Lennon once sang, "The dream is over". The dream to which I am referring is that of Maccabi Tel Aviv (the basketball club), who dreamt that they would become Euroleague champions three seasons in a row, a feat which hasn't been achieved in nearly 20 years. My, they were close....

Were Maccabi right to have this dream? Yes. Did they deserve to win the championship? No. In my opinion, it was only a fair amount of luck which managed to get them into the final at all. True, the semi-final game against Tau Vittoria showed the players in excellent form, but that game had them playing maybe twice as well as they had played all season, and unfortunately gave false hope regarding their ability in the final.

I consider myself to be far from qualified to give a learned opinion on the subject, but like every other Israeli, I too have an opinion about Maccabi. They should never have signed Will Solomon as point guard, and if having done so, they should have signed a backup point guard (Derrick Sharp is not really a pg). Last night's game showed every thing which was right and wrong about Solomon: yes, he can score three point baskets. Yes, he can penetrate. And yes, he holds the ball for too long, wasting time and often getting into trouble. When he does eventually pass the ball, whoever receives it doesn't have very much time on the clock to do anything valuable with the ball.

Maccabi's best moments last night came when they scored within eight or ten seconds of the possession. Any longer, and the defence would be too strong for them.

Even though last night's game was tough, gritty and not enjoyable as a basketball game, I have to say good words for CSKA, the new Euroleague champions. Whilst they did not play attractive basketball, they had an iron strong defence and simply did not let the magicians of Maccabi do anything with the ball. Baston was almost completely neutralised on the offense because Vujcik couldn't get the ball to him. European season MVP Anthony Parker was merely a shadow of himself, presumably because whoever was guarding him did it so well that AP never got the chance to show his abilities.

But we're talking dreams here. Even at the opening stages of the season, Maccabi had good games and had bad games, an unevenness which didn't speak well for the rest of the season. There was even talk after the first few games of replacing Solomon; in retrospect, maybe Maccabi should have swallowed their pride and replace him. By a momentous amount of luck, Maccabi finished first in the initial group, thus avoiding CSKA, Tau and Panathanaikos in the next round. They could easily have finished third, and then this season would have been a different story.

This luck gave lie to the false hope that Maccabi could do the threpeat. In the second round, they initially lost to Real Madrid (I wrote about this here) and nearly lost to Ulker. But the Maccabi magic - or luck - held true, and again Maccabi was lucky to finish first in the group, thus achieving home court advantage for the quarterfinals. The hope meter was steadily rising even though Maccabi hadn't really played well enough to justify that hope.

The three game quarterfinal against Olimpiakos showed a Maccabi which was no longer head and shoulders in front of all the other teams; rather, it was maybe even a shoulder behind. But somehow Maccabi managed to win (the home advantage played its part) and managed to get to the Final Four.

On the strength of their past few games (and also the fact that they had lost a few Israeli league games, something which happens only rarely), I really didn't expect them to beat Tau. But then Parker and Baston played their game of the season and truly trounced Tau. All they needed to do was maintain that same level and the threpeat would be theirs.

But no. I have been wondering for some time what the next season will hold. I mean, had Maccabi won the championship again this year, would they go all out to win it for a fourth time?? How many of the players would have the same fire to win next year? Haven't other coaches learnt how to beat Maccabi yet? I don't know what the contract status is, but I imagine that several of the senior figures will leave Maccabi and next year will be a transitional one.

Read all the gory details about the game at the Euroleague site.