Sunday, January 29, 2012

Watching the weight / 4

It's been some time since I last wrote about my weight and accompanying issues. I am pleased to note that I have been maintaining a body weight of 79.5 kg during that time. I would of course be even more pleased if I could reduce it, but we have been having a spell of cold weather which causes one to eat more, especially over the weekend (excuses, excuses). Also, before I was managing to walk six (if not seven) nights a week, whereas lately I've been lucky to walk four nights a week (one night is lost to MBA studies - Negotiation was on Thursday evenings and Strategic Management will be on Wednesday evenings). 

One of the Israeli dairy companies (Strauss, via their strategic alliance with Danone) has introduced a new dairy drink called Danacol. Its claim to fame is that each 100ml bottle of drink (three swallows and it's over) contains 1.6g plant sterols, which have been shown to reduce blood cholesterol by up to 10% in 2 to 3 weeks (quoting their Irish website). The Israeli website is slightly more technical, mentioning that the drink contains phytosterols (as opposed to 'plant sterols'), and a quick look at Wikipedia reveals that phytosterol-supplemented functional foods have been shown to reduce total and LDL-cholesterol levels in hundreds of  clinical trials. LDL cholesterol is otherwise known as 'bad' cholesterol; what is important is not so much the absolute amount of LDL cholesterol but rather the ratio between HDL ('good') and total cholesterol.

If I remember correctly, the ratio in my blood is somewhere between 4-5 (total cholesterol to HDL), which is too low. Hopefully, using Danacol will help improve this ratio (the ground flax seeds and walnuts are also supposed to help). To perform this test correctly, I should have a blood test taken this week in order to set a base line, and then compare the current value with a future blood test.

Again, according to the Wiki, the phytosterols complement the statin pill which I (and millions of others) take every day: statins reduce cholesterol synthesis by inhibiting the rate-limiting HMG-CoA reductase enzyme, [whereas] phytosterols reduce cholesterol levels by competing with cholesterol absorption in the gut, a mechanism which complements statins.

At first glance, the drink is slightly expensive: each bottle costs 3.75 NIS, which is about $1. Danone is running a promotional campaign in every country which allows one to purchase a six-pack with a 25% discount, so really the drink will only cost 2.82 NIS/day. I note that the Irish site has an offer for a 2 EU discount; if this is equivalent to the Israeli 25% offer, then danacol in Ireland costs the equivalent of about 6.6 NIS, which makes it nearly 75% more expensive than in Israel. A recent survey showed that food prices are more expensive here than in Europe, so this seems to be a welcome exception.

Disappointment - Finance exam results

Supposedly I am to be notified when the results of each MBA exam are posted; I haven't received such notification yet regarding the Finance exam which I took at the beginning of December, but last night I checked once again and noticed that the results have been posted.

There is a saying in Hebrew (I can't remember the equivalent in English) that 'the greater the expectation, the greater the disappointment'. I had expectations of doing very well in this exam and so was greatly disappointed to discover that my mark was only 69%. This is a comfortable pass, of course, even grade A, but I was expecting a higher score.

As I wrote before, the exam was split into two sections: twenty five multiple choice questions (MCQs), each carrying two marks, and two 'open' questions. I expected to get 20 out of the 25 MCQs correct, but my mark shows that I was correct in only 16. Those marks which I thought I had in the bag made quite a difference to my final score.

Oh well. I haven't failed the exam but I have failed myself and so the disappointment is greater. I am now revising for the Negotiation exam (first week of March) and next week I will start my final course, Strategic Management. I have no expectations as regarding Negotiation, so I'll probably surprise myself.

Thursday, January 26, 2012

Displaying a database table as a tree

A few months ago, I added to the Occupational Psychologist's management program a module which tracks calls to various clients. This is a simplified version of a Customer Management System (CMS) and became necessary when two of the OP's staff left without leaving proper documentation of their work. A single call holds the customer's name (well, the customer's id number), the subject of the call, the contact person, the text of the call and the date on which the call was made. There then arose the need to create a followup call which is based on a previously existing call; such followup calls would be stored in the same table as the original call, but obviously there need be a way of showing the connection between the two.

The logical way of doing this would be to add a 'predecessor' field to the calls table; a new call would store 0 in this field whereas a followup call would store the id of the predecessor call. For reasons which escape me now, I elected not to do this. Despite this, I will write here as if there is a 'predecessor' field in the calls table.

Use of this field is the basis of the threaded view of calls. A thread will start with one call (which has been termed the 'original' call above), then continue to a second call (the 'followup' call) and so on. The original call may have two threads arising from it, and a followup call may have its own followup call. In order to show the call hierarchy correctly, the calls have to be displayed in a tree view.

Let us assume that there are the following calls: A0 is the first call in a thread. From this call, two successor calls were made, A1 and A2. There is a successor call from A1 denoted as call A11. A separate thread was opened for the same customer, with calls B0, B1 and B11. Crudely drawn in an HTML table, the hierarchy looks like this:


Here is a partial view of how the calls table might look:

# nodesubjectpredecessor

Originally I used a fairly complicated algorithm, but looking at the problem now, I see that I can draw the tree with a much simpler algorithm which requires only one access to the database.
select id, curdate, predecessor
from calls
where customer = :p1
order by id
The resulting dataset will be the same as the table drawn above (except for the fact that I am retrieving each call's date and not its subject). Here is suitable code to draw the tree based on this dataset:

with qGetCalls do
  params[0].asinteger:= custnum;
   while not eof do
     anchor:= fieldbyname ('predecessor').asinteger;
     if anchor = 0
      then node:= nil
      else node:= FindFatherNode (anchor);
     AddChildObject (node, fieldbyname ('curdate').asstring, pointer (fieldbyname ('id').asinteger))

Function TShowCallsTree.FindParentNode (father: longint): ttreenode;
 node: ttreenode;

 node:= tv.nodes[0];
 while (node <> nil) and (longint ( <> father) do node:= node.GetNext;
 result:= node;
The above code is unchecked but looks as if it should do the work correctly. The hack part of this code uses the data property of each tree node. Nominally, this is a pointer which points to a dynamically created record holding some form of data connected with the node (indeed, I saw code a few days ago which worked this way, creating a pointer to a record with new and then saving the pointer in the data property), but when the data to be stored is an integer, it can be stored directly in the data property, via a type cast, and of course can be retrieved directly. 

The FindParentNode code as written is very simple - and possibly very slow, as every time it is called, it has to start from the first node in the tree. At the moment, I think that each customer has less than ten calls (meaning ten nodes in the tree), but in a year's time, this code is going to be slow and will probably need some form of optimisation. It turns out that there is a GetPrev method, which returns the previous node in the tree; it should be quicker to start always at the end of the tree and move backwards. The final node in the tree is always known as this is returned by the AddChildObject method (I neglected to save this value in the code above). This assumes, though, that the speed of GetNext/GetPrev are similar; even so, a 'backwards' approach would require checking fewer nodes.

Sunday, January 15, 2012

Tinker Tailor Soldier Spy

I wrote a few months ago that I had heard that John Le Carre's classic 1974 book had been converted into a film, this thirty years after the BBC made a seven part television series. I had the pleasure of watching the film yesterday; I'm not sure of my response.

The book shown on the left of course is not the same as my copy, but rather a new printing which ties in with the film - that's Gary Oldman as George Smiley on the cover. I think that Sir Alec Guiness made a better Smiley.

I think that I know the book so well that I am unable to appreciate someone else's version of the story. Instead I nitpick:
  • Operation Testify now takes place in Budapest, Hungary instead of Brno, Czechoslovakia (as it was then) - because it was 20% cheaper to film there! The book version of Testify is completely different to the filmed version, which actually begins with this. Whilst this is chronologically correct, the operation is revealed only about two thirds of the way during the book, in order to maintain the reader's curiosity (and also because George Smiley has to find out on his own what happened).
  • Some of the scenes with Jim Prideaux and the boarding school are shown (doesn't Bill Roach look like Peter Griffin from 'Family Guy'!) but appear in the wrong place as per the book. The episode where Jim Prideaux strangles the owl (or whatever it was that flew out of the fireplace) is shown but misses its resolution: the whole point of this was to hint at who killed Bill Haydon at the end (his neck was broken, where in the film he is shown being shot). This is called foreshadowing and is an example of the Chekhov's gun trope. The film bungles this.
  • George Smiley's house has moved inexplicably from Chelsea to Islington, and Ricki Tarr has his adventure in Turkey as opposed to Hong Kong (Portugal in the BBC version). Budgeting again? 
  • Someone got confused between Sam Collins and Jerry Westerby: Sam's lines were spoken by Westerby! So why was the character not called Collins?
  • Smiley's hotel has moved from near Paddington to near Liverpool Street.
  • Russian spy Poliakov was only a veiled threat during the book, where he appeared in one scene at the end; in the film we see him frequently.
  • Whilst Irina was shipped off from Hong Kong by plane, here she is shipped off (literally); that's understandable if her part of the action took place in Istanbul. But why on earth was she presented during Jim Prideaux's interrogation? There was no way that Prideaux could or should have known who she was. And as for her demise ... the one truly shocking moment of the film ("I didn't see that one coming" - Austin Powers).
The casting was also slightly strange: in my humble opinion, Cieran Hinds (Roy Bland) would have been much more successful as Sir Percy Alleline than Toby Jones was; Hinds had the height of the fictional Alleline and was much more threatening. Colin Firth was wasted as Bill Haydon; his charisma was never shone (Firth hardly spoke) and one never got the sense that everyone knew it was him but was afraid of saying so (although this is mentioned right at the end). As for the characterisation of Toby Esterhase, the less said, the better.

I can't say whether the story as presented makes much sense. So much seems to be a fait accompli, Witchcraft is presented at the beginning and Smiley doesn't have to ferret out the truth.

It's ironic that Irina was shipped back to Russia from Istanbul. The general story of Bill Haydon was based on that of Kim Philby; John Le Carre himself (under his born name of David Cornwell) was one of the spies blown by Philby. Philby himself was nearly blown by the attempted defection of a Russian spy called Volkov; the telegram offering his services (like Tarr's telegram) ended up on Philby's desk, who was able to arrange the capture of Volkov. Volkov was then invalided out of Istanbul onto a Russian ship, like Irina.

Saturday, January 14, 2012

More City Boy

When I was listening to City Boy in the mid to late seventies, there was of course no Internet and very little transfer of information. That can easily be rectified now. The picture below shows drummer Roy Ward (first on left), who joined after original drummer Roger Kent (first two albums) left (fired?) the group.

l-r: Roy Ward (drums, lead vocals), Mike Slater (lead guitar), Chris Dunn (bass), Max Thomas (keyboards), Steve Broughton (lead vocals, rhythm guitar), Lol Mason (lead vocals).
A little bit of work today revealed three sites worthy of attention:
  1. An interview with Steve Lunt, aka Steve Broughton, joint lead singer with City Boy. It's not mentioned in the interview why he changed his name; I believe that Lunt was his original name which he changed to Broughton during the CB days. This is most confusing as during the early to mid seventies, there was a group called the Edgar Broughton Band from the Birmingham area (Warwick), whose bassist was also named Steve Broughton, Edgar's brother.  Just to add to the confusion, the City Boy 'where are they now' page says that his name was Steve Blunt.
  2. A message board, containing plenty of information about City Boy (as well as much extraneous information; one has to sift).
  3. A concert recorded at the BBC prior to the release of their first album! This shows how capable they were of reproducing their recorded sound live - in fact, so close that I'm not too sure how valuable it is listening to the concert. I normally find live or rehearsal recordings illuminating as regards the released versions, but here there's very little difference (obviously no double tracked guitars, and the keyboards are barely audible).

Friday, January 13, 2012

Caught in a musical timeweb

In 1977, I went a few times to concerts at the Roundhouse in Camden Town, London. In those days, the bill would feature three groups with hopefully some form of compatibility between them. One Sunday, the bill was headlined by Van der Graaf Generator supported by two punk/pubrock groups (the 101ers, including Joe Strummer, who went on to The Clash). I have never seen such an antagonistic audience (including myself shouting 'Get off!' at the support); someone made a mistake with that bill!

In June 1977 I saw Caravan play, supported by an otherwise unknown group called City Boy. Actually, I had heard the name before: in 1975, I started reviewing lps for my university's newspaper and received in the course of my duties records and information packs about upcoming acts, including the above mentioned City Boy. Their information sheet must not have been too attractive as I elected not to ask for their record.

Anyway, in my opinion, City Boy blew Caravan off the stage. A few days after the concert, I bought their current record (their second) called 'Dinner at the Ritz', and a few months later I bought their third album, called 'Young men gone west'. I dimly recall  finding their eponymous debut album at Swiss Cottage library and taping it.

Fast forward to the 2000s and the cd age: I managed to find a compilation cd by City Boy called 'Anthology' which contained a melange of tracks from all their albums, presented with no logical order. Finally in the past few days I managed to locate the original albums, after which I burned a copy of the eponymous album in order to listen to it in the car on the way to studies (It seems that most of their albums are now available on cd, which wasn't the case a few years ago).

The core of City Boy came from a semiprofessional folk group which played in the Birmingham area; some of the folk sound came through to the record, especially the opener ("Moonlight") and the closer ("Haymaking time"). Inbetween was a sound somewhere between pop and rock; they have been described as a mixture of 10cc and Queen.

The 10cc comparison comes mainly from the smart alec lyrics, written by singer Lol Mason (and funnily enough, 10cc had Lol Creme, LOL), whereas the Queen comparison probably comes from the amount of electric guitar liberally sprayed around the songs.

There are parts of the record which still hold up, 35 years after the event. I'm not one for screaming electric guitars, which makes listening to part of the record a bit difficult. But there are still some excellent songs which reward one. 'Dinner at the Ritz', as I recall, was even more guitar orientated (and featured the saxophone of David Jackson and voice of Peter Hammill on the eponymous track), whereas 'Young men gone west' was more laid-back and mellow. After these first three records, they aimed for a more pop/rock sound (hit single '5705') which I liked less and less.

I listened today to 10cc's 1976 record, "How dare you!"; whilst there might be grounds for comparing City Boy's lyrics to those of 10cc, 10cc leave City Boy in the dust from a musical point of view. City Boy had conventional and singable songs with conventional arrangements, whereas 10cc (in those days) were anything but. Unfortunately, Lol Creme and Kevin Godley, who were the anarchistic half of the group left at the end of 1976, and 10cc went on to be much more conventional.

Their 1977 offering, "Deceptive Bends" was a mixture, with only one song reaching the heights of their previous offerings ("Honeymoon with B troop") and a few others which were reasonable ("Good morning Judge" and frequently played hit, "The things we do for love").

One of the more annoying tracks on "Deceptive Bends" was an uptempo song called "You've got a cold". It so happens that one of the best songs on City Boy's debut album was called "Doctor Doctor", which covers a similar lyrical topic (only better) and has a killer bass riff (as does "You've got a cold"). I wondered then (and now) whether 10cc even knew of the City Boy song when they recorded their song.

Sunday, January 08, 2012

Tooth extraction

I had the dubious pleasure of having a wisdom tooth extracted on Friday. I wrote about this before, at which time a date was set in February. The clinic called me on Thursday, presumably because they had an empty slot, and as it happens, I too was available.

As I have a particularly strong gag reflex, the hardest part for me was accepting the local anaesthesia. This was eventually accomplished with much gagging, choking and spitting. The dentist sprayed my throat with the same spray which is used during an gastroscopy, although there it is accompanied by a very quick acting version of the date-rape drug, which apart from relaxing the patient, prevents the creation of memories.

Once we got over that part, there was only the minor problem of extracting the tooth. I got the feeling that the tooth was extracted in three parts; it didn't hurt but was uncomfortable. Afterwards, I bit on a gauze pad to stop bleeding. I was given two simple pain killers which more than did their job: there was no pain in the evening or on the following morning, for which I am thankful.

So: there only remains the problem of the embedded tooth. The dental expert wants it removed whereas I don't - at least, until it causes problems. If I do have to go to hospital, then I am going to try to obtain special anaesthesia.

Saturday, January 07, 2012

The difficult negotiator

I freely admit that I am only taking the MBA course in Negotiation because of timetable scheduling. If I had more freedom and were prepared to take more than one course per semester, then I probably would have taken a financial course. Even so, the Negotiation course is intellectually stimulating.

Today, when reading the course book, I came across the following paragraphs, written about handling the difficult negotiator (I have edited it slightly to make it more comprehensible when taken out of context; the 'Thompson' referred to is not Richard Thompson but rather an argumentative and unpleasant trade unionist).

It might therefore be useful to tie together some general advice on how to handle a difficult negotiator. First, you must separate people who are difficult only with you from those who cause problems for everyone. It might be you that is the cause of the difficulty and not them. What are you contributing to the difficulty of the relationship? What have you done, or been perceived to have done? Whatever it is, you had better put it right.

Some people, however, are deliberately difficult because they have found that their behaviour usually produces what they want. For them there is a direct connection between their behaviour and the outcomes they seek. Their behaviour intimidates their ‘victims’ into submission and where it does not have this effect we get the kind of problem represented by the Thompson situation – bitter contests of will, much stress and tension and a totally Red–Red manner from both him and the managers. Dealing with these types of difficult negotiators sometimes prompts a debate on whether to match or contrast their behaviour. 

The choices of matching or contrasting look like another dilemma because neither response answers the key question of what you are supposed to do next. The clue to the answer lies in what outcome the difficult negotiator is seeking from his behaviour – he intends that you will submit. Hence, your tactical aim is to deprive him of that purpose by disconnecting his behaviour from the outcome.

The response to all forms of difficult behaviour can be summed up in the statement that ‘your behaviour will not affect the outcome’. Whether you express this statement directly to the difficult negotiator must depend upon the circumstances, but you certainly must articulate its meaning to yourself in all circumstances. Let it become your mantra!

By disconnecting his behaviour from the outcome you will also cease to make his behaviour an issue – how he chooses to behave is his business not yours. Hence, all temptations to advise him on how to behave must be resisted. Statements like there will be no negotiations until ‘he changes his manners’ or until the ‘union is back into procedure’ and so on, are a waste of time and re-connect the behaviour with the outcome. Realising that his behaviour is not going to influence the outcome – you are not going to submit to it – does more to change his behaviour than confronting the behaviour directly.

I too have my private Thompson, my bete noire; this is someone who runs a subsidiary company to mine. For some reason I was designated the point of contact regarding the inventory which he holds on a consignment basis (ie it's our inventory which he pays for when he sells). Every few months, relations grow very hot under the collar, and at one point I refused to have any more to do with this person, so unpleasant is he. In a discussion with my company's president, it turns out that everybody feels the same way as our private Thompson.

The above quoted paragraphs from the Negotiation text should be my mantra: his behaviour will not affect the outcome!

Sunday, January 01, 2012


One of the minor television channels in Israel started showing the British drama series Spooks from the beginning, and I was fortunate to see all the episodes screened, starting from the beginning (previously I had seen a few episodes from the seventh or eighth series and didn't really understand very much).

The first series started off promisingly by showing as much of top agent Tom's out of office life as it did his in office life. The second series was even better than the first and finished on a huge cliff-hanger. As episodes were being screened here on a nightly basis, I didn't have to wait long for the resolution. One thing became clear about this series: anybody could die (or at least, leave). This was signaled in only the second episode when one of the staff was killed, but the second episode of the third series had main character Tom being sacked after undergoing what amounted to a nervous breakdown.

His leaving was signaled in advance by the addition of a new character in the first episode of the third series; this signal was to be repeated twice more during the same series as two of the other mainstays (Zoe and Danny) also left the series. Might the fact that the actress playing the part of Zoe left her husband in order to live with the actor playing the part of Tom have anything to do with this?

The fourth series opened with 50% of the original cast/staff having been replaced and an emphasis on more action orientated stories. I have to admit that I prefer the more cerebral stuff. I don't think that a gun was shown at all during the first series, whereas the series 3 closer and the series 4 opener had guns alore - which were used. The body count in one episode was higher than the entire first series (and possibly the first two series). 

As I've only seen the first two episodes of the fourth series, I will refrain from making more comments, save to say that these episodes brought a change of style which I didn't care for. Although I had recorded all the episodes (for the show is shown late at night), to my chagrin I had deleted almost all of them, and only the last few episodes have found their way to permanent storage. I'm going to retain all the episodes from now on, and recover the missing episodes from the Internet.