Tuesday, June 05, 2012

Post mortem on 'Strategic Planning' exam

This is the way the world ends
Not with a bang but with a whimper
(T.S. Eliot, 'The Hollow Men')

Such were my feelings at the end of the exam, for this marks the unofficial end of my MBA studies (the official end will presumably be when I get the results for this exam, or even at the ceremony next year in Edinburgh). The entire affair was anti-climatic. It was hard to revise for the exam because there wasn't exactly a set of facts which had to be learnt; true, there was a format (with about fifteen items) to be memorised, and one had to remember the advantages and disadvantages of the process model, but that was about it. Like the final exam of my first degree, the subject matter was, in a sense, everything that we had been taught in the preceding courses. 

The exam consists of three questions: the first is a numerical exercise which requires a strategic evaluation (or recommendation); the second is a non-numerical real world case study which also requires a strategic evaluation, and the third is an essay question. Those with whom I spoke before the exam weren't too worried about the first question and only slightly worried about the second. Most of us were worried by the vagueness of the third question which could be about anything under the sun and phrased in inscrutable language which only hints at what is needed.

And so - the first question was, as usual, about the Acme company. Unlike most examples of this question which we have seen, this question had three current products as opposed to two current products and two in development. This made the question slightly easier although required more writing as all three products had to be covered. Two of the products have PLC (product life cycle) of maturity approaching slow death whereas one was in the growth phase. This means that all the strategic discussion was completely different for the third product. As a teaser, we also had to discuss the financial manager's suggestion that resources (work hours, marketing and development budgets) be shared equally between the three products. Obviously he was unaware of the different requirements due to different PLC stages. The question wasn't hard but it required an hour of concentrated writing.

We had been advised to start with question one, then continue to question three and finish with question two. So, dutifully, I read question three, which read something like this: The senior managers of the company were each specialists in their own field. Their CEO gathered them together for a meeting with a strategic analyst named Stanley. All the managers were dubious about the meeting but after two days with Stanley, their opinion changed completely and they were very happy to have taken part. What did Stanley tell them?

Assuming that one ignores facetious answers like the winning numbers in next week's lottery or that Stanley took the managers for a 48 hour orgy, one assumes that Stanley revealed the strategic planning/process model. Each manager has his own goals (most of which are short term) without being aware of the other managers' goals. Of course, some of the goals are diametrically opposed, especially those of the production manager and the sales manager. My answer noted the above, then gave examples of what those managers' goals might be. Then I explained about the process model (see, memorising the advantages and disadvantages paid off!), noting that the fourth advantage ('identifies areas of disagreement') was most pertinent. Looking at the material now, I slightly mangled the second disadvantage although I think that I explained it well enough. After a bit of expansion, I had filled one and a half pages, which might not be enough according to our lecturer, but contained the main points and showed understanding.

Then I turned to the second question. One of the practice questions which we had looked at was about HP and the factors which lead to the appointment of Ms Carla Fiorina; this question was also about HP and Ms Fiorina. At first I thought that it was the same question but it quickly became apparent that whereas the first question was about the start of Ms Fiorina, this question was about the end of her period. Basically, the question asked: was it fair for the Board of Directors to sack their CEO? Of course, there was a great deal of information which had to be analysed according to the model of strategic planning but a certain weight was placed on the student's recommendation (and of course, the reasoning behind said recommendation). I might well have presented the data in a rather more unstructured format than I should have, but I think that I was perfectly clear about my recommendation (I think that HP should have devolved into smaller companies, keeping Fiorina as CEO).

So how well did I do? From the grading guides which I have seen, it is very difficult to achieve an outstanding mark in this exam. It is also quite difficult to fail - as long as one uses the analysis format (which has been drummed into our heads) and one mentions the process method enough times. So it's clear that I passed although I have no idea what the final mark will be.

Results at the end of July.

Monday, May 21, 2012

Very very busy

The fact that I haven't written anything for the past week (and more) reflects that I have been too busy to even consider writing anything. Here is a list of tasks which I have to perform outside of my daily job, along with their priority
  1. Prepare for exam in Strategic Planning (7 June)
  2. Prepare for holiday (14 June)
  3. Support the occupational psychologist
  4. Continue sequencing and recording my versions of Van der Graaf Generator songs
  5. Work for LaTet
Hopefully that's all.

Apart from attending lectures and preparing exercises, I've also commenced rereading all the theoretical material necessary for the Strategic Planning course. The exam consists of three questions; the first requires examining all the financial data given in a structured manner, which is not hard, but one has to remember all the items in the structure. At the end, one has to make some form of comment. The second question is similar to the first, but here there are no financial figures, only comments about how the company is faring, what problems it is facing, etc. The third question seems to be entirely open, but we have been warned that it is often about the 'agency' problem, which boils down to how two people in the same organisation see things differently. I'm not worried about the exam and feel that my revision is on schedule.

Most of the preparation for the holiday has already been done: I've booked flights, accommodation and excursions. I've even bought video cassettes. Hopefully there's very little left to be done, and what has to be done will be done after the exam.

Fridays I devote to the OP; this schedule seems to be working fine at the moment.

On Saturdays, when I can't read any more about Strategic Planning, I work on the songs. I completed a version of 'Refugees' very quickly; the sequencing took only a few hours, but the vocal (and more to the point, processing the vocal) took longer. I completed an arrangement of 'Pilgrims' but had great difficulty in singing it so I have yet to record a vocal. In the mean time, I discovered that sheet music of this song had appeared on the web; I printed out the staves and compared it to my version - I would say that there was about 95% correspondence, so the alterations needed to my version were minor. For the first time, I have created a guide music track, along with a clarinet playing the tune. Unless things drastically improve, it looks like I am going to record the vocals against the guide track and then mix them with the 'proper' arrangement. This way I should be able to sing the tune properly.

I donated a few more hours to charity yesterday afternoon/evening. The previous week we had talked about a report which monitors the effectiveness of the telephone staff (who call people in order to obtain donations). In a few spare moments at work, I prepared a skeleton version of the report; yesterday I completed the report and debugged it against the real data of the charity. My opposite number was very effusive in her praise; apparently the two hours which the report took me to write will save them innumerable hours and make them more effective. Probably the next task which I will tackle will be recording data about the 6,400 volunteers - I have to define the framework, they'll enter the data - but I won't have much time before my holiday.

And of course, there is always work. The past few weeks have been very intense; I have been occupied with several projects, instead of just turning up and helping people with their latest problems. Well, of course, it's always better to be busy than idle, but I do wish that there were fewer concurrent projects.

Thursday, May 10, 2012

Charity begins at home

There are many charities in Israel; some would say too many. Some of these, especially those connected with orthodox Jewry, might be on the dodgy side. Twice a year, at New Year and Passover, many charities appeal - these days, by phone - for donations. Whilst I don't mind giving money to charity, I don't like being approached in my home for money. A few years ago, I decided to give money only to two charities; this way I could fob off any other charity by saying that I had made a charity budget and had already donated that budget.

One of these two charities is 'LaTet' (to give), which provides food for families below the poverty line; I can't recall at the moment the name of the other charity, but it cares for autistic children. Both charities made a great step forward last year when they introduced automatic monthly donations via credit card. In one fell swoop, they improved the amount of donations that they receive, they required less manpower to achieve those donations and they also made it easier for the donators.

I received a few months ago a receipt from LaTet, noting absent mindedly that the receipt was printed via Priority, the same ERP program that I use at work. The only thing that struck me at the time was how such a program could be so flexible to support both a company which manufactures furniture and a charity. 

Last Friday night, I was walking after dinner, looking at the full moon and at the city of Bet Shemesh, whose population is an uneasy mix of secular, traditional and ultra-orthodox Jews. I wondered how many people there had enjoyed a full Sabbath meal and how many had gone hungry. I idly wondered whether I should volunteer a cooked meal every week (I have done this on occasion for families on the kibbutz in special circumstances) or even volunteer to deliver meals. But then I realised that if I really want to make a contribution, then I should do it in an area where I have a competitive advantage (as we say in MBA speak): implementing Priority.

Fired with enthusiasm, I found the website of LaTet, and sent them an email volunteering my services in improving their implementation of Priority. I have no idea whether they make good use of the program or whether they simply know the basics, but at least I am prepared to help.

I had half forgotten about this until yesterday afternoon, when a lady telephoned me, saying that she was from LaTet, and that I could contribute to them a very valuable service by donating my time and knowledge (those aren't her exact words by any means; hers were more like 'hitting the nail on the head'). It seems that their use of Priority is somewhat basic/lacking. She said that they had no money to pay for a consultant to do a professional job and so they were very pleased that I contacted them. We agreed to meet next Sunday, when I will go to their offices and learn what they are doing.

Later I realised that they hadn't checked my bona fides; I might not be an expert in Priority (a fact which would quickly arise in our meeting) or I might be an expert, so expert that I could extract from them money without them knowing. Unfortunately, there have been several cases in which charities have been fleeced (either knowingly or unknowingly) so this possibility definitely exists. There was a small uproar a few months ago about this charity when it was discovered that the general manager was receiving a monthly salary of 30,000NIS. I, probably like many other people, thought that he was donating his time for free (Shimon Mizrachi is the chairman of the Maccabi Tel Aviv basketball club and he definitely donates his time). A crook might see this as an opportunity to improve his standard of living.

It later occurred to me that the 'not having enough money to pay a consultant' story didn't quite ring true: I know that we pay 30 thousand NIS twice a year in order to use Priority. This payment covers licensing issues along with help desk support and is compulsory. It may well be that this charity has much fewer users than we do and also fewer modules (after all, they don't need the production side at all which greatly simplifies matters) so their annual cost should be much lower. Maybe the company from whom they receive help desk support even waived the cost as a donation. Whilst I won't ask about the money side, I will ask if the charity receives help desk support and from whom. Help desk support is not implementation and development, which is what I do.

It will be very interesting to see how they run their business and how it can be improved. Like every good deal, both sides should derive profit (not necessarily monetary) from the agreement. They should be able to improve their existing and potential customer management whereas I should be able to learn another organisation's need (grist for the doctorate mill).

I should note that this is the first time I have done anything like this. Of course, I have donated my programming time to deserving causes on the kibbutz, but that's like (or at least, was like) helping my family. It's not nationwide charity work.

More on this subject in a few days after the meeting.

Wednesday, May 09, 2012

Early footage of The Band

In the wake of Levon Helm's death, footage of The Band at various stages in their career has started to appear on YouTube. I only became aware of this the other day, so I haven't had much of an opportunity to view the footage, nor see how much is pre-Last Waltz and how much is post (I have The Last Waltz on DVD).

I did see two versions of 'The Weight' - the first was from Woodstock (yes, The Band was there but their manager, Albert Grossman, didn't want their material in the film or on the soundtrack, possibly because Robbie Robertson's microphone was live) and the second from a concert in Pittsburg a year later (there are four songs in this film). I want to focus on this latter footage which seems to have been made by a single camera.

The camera starts off by focusing on Robertson - after all, he is the guitarist, appears to be leading the musicians and has a microphone in front of him into which he appears to sing - but after a while, the cameraman realises that Levon Helm behind the drums is the one who is singing the verses. During the chori, he pulls back to show Rick Danko (and Robertson) singing. Where does the third voice in the chorus break come from ('and ... and ... and ... she put the weight back on me)? From Robertson, of course. Richard Manuel? Never heard of him. Garth Hudson? Unheard and unseen.

After the cameraman finally learns that Helm is singing the verses, he returns to the drummer at the beginning of every verse, only to discover in a panic that Helm is not singing the fourth verse.  It takes a while, but the camera pulls back and starts searching for someone moving his lips. Eventually it settles on Rick Danko, singing about crazy Chester.

As there was only a single camera, there obviously was no director who can be blamed for not doing his homework. So the sole cameraman is guilty: he didn't bother to find out who the vocalist is before the concert. Poor man: little did he know that The Band had three world class vocalists who would often sing in unison or pass the tune around (at least in the early days). 

"Time to kill" is the opening song which features a constant duet between Danko and Helm; the camera stays on Danko almost all the time and one is left to guess to whom belongs the second verse.

There are means of saving films shown on YouTube as avi files; I am storing these clips and will one day burn them to DVD.


Sunday, May 06, 2012

ERP beats Excel at CRM

Today I witnessed what was supposed to be a small victory in my fight against using Excel in the workplace. I was called into the General Manager's office where I was asked about our ERP program's abilities in the realm of Customer Relation Management (CRM). I explained that I had developed a module several years ago for tracking events and all the people that were invited to that event, including the status of each person (invited, declined, participated, etc). I also explained that I have instructed at least four people in the use of this module and none of them had left much of note (all of these four no longer work with the company and I sincerely hope that there was some other reason than this module!).

Enter the woman who has been dealing with CRM the past few months. She of course has been maintaining her 'database' in Excel and sees nothing wrong with that. The GM told her that her data have to be transferred to Priority so that they can be managed properly - here is my small victory (I didn't have to persuade the GM that Priority is a better tool than Excel for CRM).

A few hours later, the woman sent me her spreadsheet and straight away I knew that we had a problem. Although theoretically I can simply copy her list of contacts and paste it into Priority, this won't work in practice because not all of her contact have previously been defined in Priority. Not only that, some of the contacts were defined with first names only; as unfortunately no one has ever bothered to devote the necessary amount of attention to defining contacts in Priority, some of the contacts already existing are also on a first name basis only. There may be a match between the first names, but the non-existent surnames may well be different.

I tried to show her how to work with the program but she wasn't too enthusiastic. "Why can't I continue to maintain my lists in Excel?" was the question; I explained to her why Excel is not the tool for the job. At the moment, we have deadlock as she is not prepared to take her list, to check whether each person exists in Priority, to check the details, etc.

Hopefully she does appreciate the value of the data once they have been entered. But she's heavily pregnant and wants to get the job done today (this is a failing of many people here; they want to get the job done but don't want to handle the necessary paperwork). We are currently waiting for the GM to return in order to discuss the subject further.

Thursday, May 03, 2012

Some MBA metadata

At yesterday evening's session (where we went over an old exam question discussing the performance of a company which has branches in Britain and America), I acquired some MBA metadata:
  • 24% of the students who took the Finance exam with me in December failed outright
  • A further 7% received a conditional fail (this means that they scored between 45-49%; under certain conditions this might become a pass)
  • Several of the students who are studying Strategic Planning with me are also studying Project Management and are finding it extremely hard (or rather, finding that the lecturer doesn't lecture very well).
The Finance results are interesting. Apparently, quite a few students memorised the multiple choice questions which have appeared in previous years. Out of the 20 MCQs which appeared this time, only one had previously appeared, so these students were already at a great loss. Apparently they hadn't bothered attending the lectures or hadn't absorbed the material (and we had a good lecturer). I don't know who failed - I haven't seen most of the students from that course since.

As regards Program Management, I was fortunate in that a Scottish lecturer came and gave us three extra lectures. His material was highly illuminating and basically sorted out the entire course. I'm sure that those who attended his lectures did well in the exam (as did I). I will give my fellow students my notes, but I suspect that they won't derive as much from them as I did (given that the notes are in English and in my handwriting). Perhaps I should give them a tutorial.

Sunday, April 29, 2012

Two films

I saw two films yesterday which couldn't have been more different in style and in content: 'The girl who played with fire' and 'Serious Moonlight'.

The first film ('GPF') is, of course, the second installment of the 'Millenium Trilogy', about which I seem to have written quite a lot. The film was in Swedish, but I'm used to reading sub-titles, so this wasn't a problem (Hollywood has only made a version of the first book so far). Fortunately, the film makers read the book and edited the multiple storylines into something much more understandable; the film runs for almost exactly two hours. In fact, I'm not sure whether the film makers dumbed down the book too much; knowing the story allows my mind to fill in any details which might have been missing from the film. Otherwise it was a faithful rendition of the story and was executed well. Not very much coffee drinking and protagonist Blom­k­vist didn't get much bedroom action.

The second film is a newish film (2009) of Meg Ryan. Co-starring is Timothy Hutton, who was Ryan's fiance in 'French Kiss'; maybe this film is the sequel to that earlier film - at least, had Ryan married Hutton, instead of Kevin Kline. The first hour of the film was tolerable, but after that it completely degenerated and finished a mere twenty minutes later. It's as if a whole section of the story had been left out. I felt short changed at the end of the film, and its good parts in no way compensate for the exceedingly weak ending. This is definitely not a film worth seeking! 

Ryan and Hutton are supposed to be a couple who have been married for thirteen years; at one stage, there is a flashback to their wedding party and some wedding photos are shown. Fair enough, but the two actors don't seem to have aged since their wedding (in other words, they look exactly the same in the flashbacks as they do 'today'). Had the producers bothered a bit more, they might have tried to get some pictures of Ryan and Hutton from their earlier film - they definitely look younger then!

Saturday, April 28, 2012

Indexing on a calculated field in a TClientDataSet

Two months ago I wrote about generic code for creating indexes (or indices, as I would prefer) on every field in a clientdataset. Yesterday I discovered two caveats to this code
  • An index is not created for a field which is not displayed
  • An index is not created for a calculated field - in fact, trying to create an index for such a field causes an error.
 I was working on a report whose query contains a field which returns a number which is then used as an index into an array ('cash', 'cheque', 'transfer'). It seems like too much overhead to define a table for means of payment when there are only three such means, so the program contains an array of strings, and certain tables contain values which index into this array. I want the report to display the name of the means of payment as opposed to the index, and so I have to use a calculated field. If the user should click on the grid's title bar, then the report is supposed to sort itself according to the chosen field; that's why there's an index for each field. But how is one supposed to create an index for the calculated field?

It took me a while to get to the correct answer. The first caveat above states that an index is not created for a field which is not displayed - but this does not mean that I can't manually create such an index. The calculated field's value is based on the value of the non-displayed field, so what I did was to create an index for the non-displayed field, but number it as if it were the calculated field.

I had to alter the 'BuildIndices' procedure so that it now reads like this
Procedure BuildIndices (cds: TClientDataSet);
var
 i, j: integer;
 alist: tstrings;

begin
 with cds do
  begin
   open;
   for i:= 0 to FieldCount - 1 do
    if fields[i].fieldkind <> fkCalculated then
     begin
      j:= i * 2;
      addindex ('idx' + inttostr (j), fieldlist.strings[i], [], '', '', 0);
      addindex ('idx' + inttostr (j+1), fieldlist.strings[i], [ixDescending], '', '', 0);
     end;
   alist:= tstringlist.create;
   getindexnames (alist);
   alist.free;
   close;
  end;
end;

Then I added two extra lines to the calling program; the calculated field is the sixth field so its indices are idx10 and idx11, and these values would have been skipped in the above code.
 BuildIndices (qReceiptsList);
 with qReceiptsList do
  begin
   open;
   addindex ('idx10', 'cash', [], '', '', 0);
   addindex ('idx11', 'cash', [ixDescending], '', '', 0);
   alist:= tstringlist.create;
   getindexnames (alist);
   alist.free;
  end;
This works very nicely.

Friday, April 27, 2012

Metonymy

This is an intellectual warming-up exercise for my proposed doctorate, discussing how the use of spreadsheets negatively affects the successful implementation of ERP programs. I literally woke up this morning thinking 'Excel', and then went over several points in my mind. The following material is probably written in an anecdotal style as opposed to an academic style, which means that this material probably won't find its way into the final product. 

 I first came across the word metonymy in David Lodge's excellent novel "Nice work". Here it is described as "substituting some attribute or cause or effect of the thing for the thing itself". Looking around on the Internet, I discover that two classical rhetoric terms, metonymy and synecdoche are almost the same thing, and at the moment I can't really distinguish between them. 

[I]t is often difficult to distinguish between metonymy and synecdoche. Plastic = credit card is a case of synecdoche because credit cards are made from plastic, but it is also metonymic because we use plastic to refer to the whole system of paying by means of a prearranged credit facility, not just the cards themselves. In fact, many scholars do not use synecdoche as a category or term at all." (Murray Knowles and Rosamund Moon, Introducing Metaphor. Routledge, 2006).

My examples of metonymy mainly come from the commercial world, in which a leading product comes to represent all the products in the same market
  • Can you hoover the carpet?
  • I'll just pop this cassette on my walkman
  • Let me google that
  • Send me some excels and I'll prepare an evaluation
Although this sort of thing doesn't happen so much in Israel, it certainly exists in the hi-tech world ("send me the excels"). I heard one lovely example of the television a few months ago during a news article discussing the affects of mobile phones on pre-teenagers: "What kind of Pelephone is your i-phone?".  Pelephone is a metonymy, as this was the name of the first mobile phone carrier in Israel (literally, miracle phone). Since then, more carriers have joined the market, but some people still refer to mobile phones in this manner.

I am sure that marketing managers would be very pleased when their product transcends the market and become the name for the market. Rowland Hanson was Microsoft's marketing manager in the early days, and he dictated that the product's name should be prefixed by "Microsoft" in order to enhance the Microsoft brand as opposed to the actual product name. His suggested name for Microsoft's spreadsheet program was 'Microsoft Plansheet', whereas other names considered were 'Number Buddy', 'Mr Spreadsheet' and 'Sigma'. 

Finally a district manager suggested Excel: Bingo!

Upon the program's release, Microsoft was promptly sued by Manufacturers Hanover Trust, which offered a computerised banking service under the same name. A settlement stipulated that use of the word was okay - as along as it was preceded by Microsoft. Rowland Hanson's revenge was complete.
(Stephen Manes and Paul Andrews, "Gates" (1994), pp 276-7.

All of the above is a long-winded explanation of why I will probably use the specific product name "Excel" in the doctorate's title as opposed to the generic 'spreadsheet'. You mean that there are other spreadsheet programs (cue a blog about the history of computer spreadsheet programs)?



Wednesday, April 25, 2012

Debt of Honour


Lately I've been struggling to read 'Debt of Honor' by Tom Clancy; reading this book is like putting one's life on hold for a few weeks. The printed version of the book weighs in at just over 900 pages; I can tell that it's a long book on the Kindle because I read and read, but the percentage meter stays at 10% (it's now at 82% which means that the end is in sight! Hurray!).

As with all of Clancy's books, it is in dire need of an editor to chop out all the extraneous sentences. It's a shame that Clancy devotes so much love to the military hardware - something with which most of his readers will have had no personal experience whatsoever - whilst devoting less attention to more familiar subjects, like characterisation.

I reflected at one point that it is a good thing that I have taken an MBA degree, as this book touches (sometimes at depth) on several of the subjects taught. There's a great deal of macro-economics and finance (spoiler: the Japanese try to take down Wall Street), there's probably project management, organisational behaviour and human resource management and there's certainly negotiation. Of course, the entire book is about strategic planning! The only things missing are accountancy and marketing.

Regarding negotiation, it was interesting to read what Clancy writes on the subject, now having completed a course in the subject. And by a neat coincidence, today the results of the negotiation exam arrived - 79! This means that supposedly negotiation is my second best subject, nestling between accountancy and project management. I will be the first to admit that my high mark is due to knowing how to answer the questions, and is not due to my extensive knowledge of negotiation. Maybe with a little practice, I might actually become a negotiator - but it's not my personality. Had I received another mark, I would have been in the 'X' grade ("A with distinction").

Friday, April 20, 2012

Levon Helm, RIP

Levon Helm, singer and drummer for the Band, died on April 19th in New York of throat cancer. He was 71. 

"He passed away peacefully at 1:30 this afternoon surrounded by his friends and bandmates," Helm's longtime guitarist Larry Campbell tells Rolling Stone. "All his friends were there, and it seemed like Levon was waiting for them. Ten minutes after they left we sat there and he just faded away. He did it with dignity. It was even two days ago they thought it would happen within hours, but he held on. It seems like he was Levon up to the end, doing it the way he wanted to do it. He loved us, we loved him."

Wednesday, April 18, 2012

Mixing and producing

Someone on the Peter Hammill mailing list asked a few weeks ago about the difference between mixing and producing (I don't recall what the background to this question was). I wrote an answer, most of which is quoted below. Unfortunately, there was no follow-up to the question, so I couldn't add any more material to my answer. But as I have a blog, I can expand as much as I want....

Mixing, in a nutshell, is balancing all the various sound sources together to make a coherent final product. This includes setting volume levels (which might change during the course of a song), panning, equalisation (tone), reverb (along with other effects), etc. This is generally done by the producer along with his engineer, although there are people who specialise in mixing songs which have been recorded by other people. The mixing stage takes tracks which have already been recorded, so the mixing engineer might have nothing to do with recording the tracks themselves. A good VdGG example would be Shel Talmy - according to The Book, Shel took the tracks which had been recorded by John Anthony for 'The least we can do' and mixed them, adding more treble.

Another good example of a mixing engineer working separately from the recording is the story of The Band's "Stage Fright". This was recorded by The Band themselves, so they can be considered to be the producers. They sent the tapes to two different producers, Glyn Johns and Todd Rundgren, and asked each of them to mix the album. The final product contains mixes by both producers, though no one seems to know who mixed what. As I have several different accounts of this process, I don't remember exactly who said the following phrase and where it was quoted, but this sums up the dilemma of the separate mixing engineer: There are four different guitar tracks. Which is the track that they wanted?

Originally, as someone else pointed out, a producer was the person who booked the session - the musicians and the studio - and liased with the record company (a good example of this would be Teo Maceo and the Miles Davis records that he produced). There would have been an A&R (artistes and repertoire) person who would have chosen the material to be recorded. In the early 60s, this situation began to change with the likes of Sir George Martin and Phil Spector, who became much more involved with the songs themselves. These days, there are several kinds of record producers: the kind that we know is someone who listens to a band demo recordings, comments on their structure, suggests instrumentation, oversees the recordings and picks the takes. Each producer has his own strengths and weaknesses, and of course his function is also dependent on whoever is being recorded. 

The best way for understanding a producer's contribution is to listen to the output of the same group with different producers - eg VdGG pre- and post- 1972. The earlier recordings (especially H to He and Pawn Hearts) have large numbers of overdubs and are quite theatrical, whereas from Godbluff onwards, there seems to be much less overdubbing and a more direct sound.

Try listening to 'House with no door' followed by 'My room' - two recordings with the same instrumentation: piano (Peter Hammill), bass (Hugh Banton), saxophone (David Jackson) and drums (Guy Evans). Listen especially to the difference in sound of the drums and vocals between the two songs: in the first song, the vocal is panned to one side and has a certain amount of reverb added to it, as do the drums. In the second song, the sound of all the instruments is dry (no reverb) and almost all the sounds (especially the vocal) are panned to the centre. In other words, John Anthony's productions are distinguished by their use of reverb and stereo. 

I'm not saying that JA's tracks are better or worse than the self produced tracks that came after the reformation in 1975 - they simply sound different. VdGG also took a producer's decision when they decided to 'dumb down' (my words) their sound when they issued 'World record', which is exceedingly simple, at least when compared to their earlier works. Of course, a real producer would have done something about the length of 'Meurglys 3'....

Obviously, the number of channels available when recording make a big difference. When a producer had only one or two tracks, there was very little that he could do regarding the technical side, so the sound would be mixed live and the producer would influence mood and rhythm. Even when there were eight tracks available (for example, 'The least we can do'), the producer was still somewhat limited, but sixteen, twenty four and thirty two tracks gave the producer much more room. Of course, in today's digital world, the number of tracks is basically unlimited, which can make the job of both the producer and the mixer very hard.

Most tracks, thankfully, are produced well, but there is the odd track which could have had a better production. I was listening to one such track today - 'Full moon' by Sandy Denny. Her first solo album was coproduced with John Wood and Richard Thompson, and features RT on every track. Whilst the sound may not be the best, it is certainly distinctive. Her second solo album, 'Sandy', was produced by husband to be Trevor Lucas, and is richer sounding and more even (I think that it's the best produced of all her records). But after that, Lucas' production skills declined (if ever he had any; Richard Thompson plays on all the 'Sandy' tracks and so counteracts any of TL's mistakes), and her final solo record, 'Rendezvous', was a complete hodge-podge.


'Full moon' is a good song: it has exquisite lyrics, a good tune but a so-so harmonic palette. The recording features one of Sandy's best vocals, improving on the written tune and providing excellent phrasing. But the arrangement - with or without the strings - is plodding and pedestrian. The string arrangement tries to be good, but it is very one dimensional. To be fair, there isn't much of a chord sequence with which to work. The only good part of the instrumental track is the clarinet solo, played by Acker Bilk (of all people). This is the work of a so-so producer.  The fact that there are five verses (four with words and one instrumental) necessitates variety in the arrangement, in order to maintain the listener's interest. Whilst Sandy's impeccable vocal certain catches the ear, the somewhat boring string arrangement and lumbering rhythm only serve to turn the user away. A good producer would have recognised that a different instrumental approach was necessary.

Tuesday, April 17, 2012

Strategic planning

As I've mentioned a few times before, my final course for the MBA degree is called 'Strategic planning'. For a variety of reasons, the flow of this semester has been problematic: frequently there has been a lecture one week but not the next. This has made it hard to get a handle on the course material. I spent some time, however, in the past week, going over the lecture notes and improving my understanding. There were only five or six lectures which dealt with source material, and most of these reiterated material which came from previous courses such as accountancy, economics, finance and marketing.

That said, a more appropriate name for the course might be 'Business Analysis': after finishing the source material lectures, we moved on to practicing examination questions, and these tend to require an analysis of a company on the basis of data provided in the question. I completed one of these exercises when I was ill and we went over it the last time we met (nearly two weeks ago).

The day following the lecture, I found myself in a meeting with one of the business units of my company, discussing their performance. This business unit behaves as if it were existing fifty years ago: there is only a nodding acquaintance with the ERP program, the manufacturing side tends to be ad hoc (every order is different and there are no real standard products) which means that purchasing similarly is haphazard. There are no real marketing forecasts and each project is manually analysed with the help of a spreadsheet. Their inventory management is a disgrace.

During the course of that meeting, our CEO performed an analysis as if he had been sitting in the lecture the previous night (he already has his MBA degree); obviously he didn't calculate financial ratios, but he was very strong on the conclusions and list of actions which have to be taken. As I commented to the CFO (my boss) afterwards, we should send all the business unit's managers to business school as it can only improve their understanding.

Since then, I've done a little work for them by giving tools for forecasts and costing, but it will take some time before they start using them (if at all). I have been trying for the past three years to get them to use the ERP program in order to run their production but this seems to be one huge up-hill climb. Until recently, I felt that there had been no progress whatsoever, but now it seems that the CEO is going to add his influence and be present at some of the future meetings, which means that changes might actually get implemented.

They performed a stock taking at the end of March and I have been working on some analyses the past few days (which is why I am reminded of my current course as I note failings and how to correct them). Today I came across a particularly egregious mistake which I thought that I would note here.

One of the standard (or almost standard) products that this business unit makes is the entire apparatus which holds the basket (see picture). I analysed the bill of materials for one such product before the holiday and discovered to my surprise and dismay that the final product was composed of 50 sub-assemblies! This means that for every such basket apparatus, 50 work orders have to be issued and there have to be 50 completions entered into the system. As at the moment, this business unit has difficulty in entering even one such completion, I can't see how they are going to enter fifty. Presumably changes will have to be made in the bill of materials in order to cut down the number of work orders.

But, even worse, today I discovered a problem with the inventory costing of this product. One of the sub-assemblies is made by a sub-contractor: we supply him with parts, he produces whatever he produces and issues an invoice for his work. So far, so good. But the good people in this business unit order from him the final assembly and not the sub-assembly which he makes - thus every time the sub-contractor issues an invoice (which we faithfully input into our system), we add another unit of the final product to our inventory. 

To use some figures: the sub-contractor charged 850 NIS for his work for one sub-assembly. But inventory recorded one complete assembly at a value of 6,000 NIS! At that moment, the value of our inventory was artificially inflated by 5,150 NIS - which of course improves our bottom line.

Ooops!

Sunday, April 15, 2012

I've sort of been on holiday for the past week and a half, which would explain the lack of blogging. It was the Passover week, during which the company in which I work is normally closed. My daily schedule was something like -
  • work - between one and two hours a day, although one day I did travel to Haifa bay, making that a full day's work
  • reading - between one and two hours a day
  • television - the Educational television ceased screening 'Spooks' a few weeks ago, reverting to 'Silent Witness'. I recorded several episodes before having the opportunity to watch even one episode, but I'm slowly working through the backlog
  • programming - I spent several hours a day at the beginning of the week working on programs for the Occupational Psychologist
  • sequencing - I've been working on sequencing a version of Van der Graaf Generator's song 'Pilgrims'. I've completed one version, but when I play it back, it gets boring towards the end. I need to find something interesting for the second chorus.
  • eating - probably too much. My weight stayed the same for the week, which I take as a good sign
Actually, the most interesting thing that happened took place before the holiday -  a week ago last Wednesday, I had a lecture in Strategic Planning, where the class discussed a problem that we had been set, which was about a company with several products, some of which were losing their way. The next day, I took part in a meeting at work about one of our business units which functions as if the computer had yet to be developed. I felt that the evening before, I had been going over the academic aspects of how to run a company, and that during the meeting, I was getting a practical lesson in running a company. My conclusion: the managers of this business unit ought to take a course in business studies!

If I'm talking MBA, then I have to report on our mystery visitor from a fortnight before. I talked with a student who had been hovering near the economics lecturer while he had been talking to the visitor, so she recalled who I meant. She didn't know who it was, but she was certain that it was not Professor Schechtman. The only real way of knowing is by asking the economics lecturer, but he has finished his series of lectures on a Wednesday evening and so I will never see him again (unless we have some form of graduation ceremony, but I doubt this).

Wednesday, April 04, 2012

Spring is in the air

April might be the cruellest month, but as far as I am concerned, it welcomes the arrival of Spring. The clocks went forward last Friday, giving us an extra hour of sunlight in the evening (but I'm walking the dog at dawn); the temperature has increased by a few degrees, causing me to change to my summer footwear (Crocs Santa Cruz), and all the worries which were shackling my feet for the past month have disappeared.

Spring is in the air!


It's also the time when thoughts turn towards summer holidays: I've tentatively started planning this year's adventure. Our destination will be Dubrovnik, where we will spend about ten days. Dubrovnik offers a wide range of self-catering apartments of various sizes, and these seem to be a cheaper but more conducive environment than hotels. These apartments also seem to be  reserved very quickly which is why I have already booked an apartment in the building whose picture appears on the left. We'll presumably have have half of the top floor.

The next most important factor after accommodation is transport; I spoke with our travel agent yesterday about flights from Tel Aviv to Vienna and thence to Dubrovnik, but she said that in the summer months there are direct flights from Tel Aviv to Dubrovnik. We'll get an update in the next few days.

I have probably written this before: sometimes it seems that I derive more satisfaction from arranging these trips than I do from actually taking them. This time I intend that we have time for evening strolls on the beaches or in the Old Town, a chance to relax and enjoy ourselves instead of a compulsive need to try and see as much as possible whilst utilising every minute to the maximum. I've been setting up a variety of day excursions (including visits to Montenegro and Mostar), although I haven't ordered these yet.

One thing of which we will have to beware is the vast number of day trippers who descend upon Dubrovnik (by staying over a week, we can morally look down on most of the tourists!) from the huge ships which ply the Adriatic. This will mean that most days we will take a trip out of Dubrovnik during the central hours of 10am - 4pm, then spending time in the city in the late afternoon/evening.

Saturday, March 31, 2012

Sequencing "Darkness" / 2

Having nothing better to do this morning, I decided to record vocals for my cover of Van der Graaf Generator's "Darkness". The first and third verses went well enough but I had several problems with the second verse, requiring several takes. I then 'comped' the vocal track and put it through the pitch corrector. The original song is in the key of E; this was too high for me so I dropped my version down to C. Whilst some parts were easier to sing, I found myself having to reach for the C# an octave above middle C. I just about got there (and of course the pitch correction software helped) but those high notes have no power.

Whilst mixing the song, I decided to make a change in the music track: this has a flute on the right hand side and a French horn on the left. During the instrumental solo, I thought it would be a good idea to exchange the instruments' stereo placement, which required a little mixer automation.

The vocal, as always, sounded too polite (partially due to the high notes). It sounded good in mono so I didn't use my usual technique of recording in stereo and delaying one side by 50-60 milliseconds. In order to get parts of the vocal sounding more evil, I copied the vocal track to a new file, silenced the parts which I didn't need, converted the file into stereo, added a little delay on one channel and then flanged the track. The idea of the above is to thicken the vocal track at specific parts, adding a little distortion. The result is interesting but not exactly what I was looking for.

I uploaded the track to the Internet; it can be downloaded here.

After listening a few more times to the track, I came to the unavoidable conclusion that the song is still pitched too high. I transposed the song down another three semitones (it's now in A) and created a new music track. I'll listen and get acquainted with it before trying to rerecord the vocals.


Thursday, March 29, 2012

Nobel prize winner visits MBA


Wednesday evening is MBA evening this semester; unfortunately I seem to have been cursed and have managed to make only five out of eight meetings.

While waiting for our lecturer to appear, I noticed further down the hall a tall and distinguished gentleman holding a conversation with the lecturer in Economics. It took me a moment to place his face; unless I am much mistaken, I was looking at Professor Daniel Shechtman, who won the 2011 Nobel Prize for Chemistry. 

This is most peculiar, as I can't imagine why such a distinguished academic would show his face in a somewhat run-down institution (whilst we learn a British curriculum run by a British university, our lectures are held in an Israeli college whose rooms have seen better days), especially as we are a business school and he is pure science. Maybe he was a childhood friend of the Economics lecturer?

To my regret, I didn't approach him, primarily because I had nothing to say to him except 'what an honour'. And what if it wasn't him? 

Sunday, March 25, 2012

Pharyngitis, Darkness

I spent most of last week resting at home, after having been diagnosed with pharyngitis. As part of the public service, "Learn something new each day", I discovered that pharyngitis and tonsillitis are both infections in the throat that cause inflammation. If the tonsils are primarily affected, it is called tonsillitis. If the throat is primarily affected, it is called pharyngitis (I didn't know what the difference between the two types of infection was).

My throat had felt like it was participating in a sword-fight every time I swallowed; funnily enough, talking seemed to alleviate the pain (and I had to talk a lot last Sunday and Monday). But by Tuesday I was feeling very weak so I managed to drag myself to the clinic where I was diagnosed (without a throat swab, I note). The doctor prescribed antibiotics and pseudoephedrine, which was supposed to act as a nasal decongestant.

Fortunately, I didn't run a high temperature; most of the time I simply felt weak, along with great difficulty in swallowing and producing large amounts of mucus from my nose. I could also barely speak.

I spent the time by working from home, reading and by completing a new cover version of a Van der Graaf Generator song, "Darkness". I found a version which I had sequenced once, which was about 90% complete. Unfortunately, I apparently had aimed at sequencing the song as it was played (including double sax parts) as opposed to creating my own version of the song, so after I completed the copy, I then started a new version which borrowed only slightly from the original. This alternate version is much lighter than the original, which is just as well, as one couldn't really create a darker version had one tried.

Looking at this song now, some 41 years after having heard it for the first time, I am struck by how much it displays Peter Hammill's unconventional approach to chord sequences. There is nary a minor chord to be found, but there are almost all the major chords based on the white keys; the song is in E and features E, F, G, A, C and D. Note that the dominant fifth chord, B, does not appear. 

When I sequence a song, I first get its structure correct, then start adding fills and solos. This latter stage can last a long time, as I listen to the song repeatedly and get new ideas. When taking the dog for a walk (I was feeling a little better at that time), I played the song once more in my head and noticed a similarity between a few bars of 'Darkness' and 'Something in the air' (Thunderclap Newman). I immediately took the instrumental part of SITA for those bars and pasted them in to the corresponding place in 'Darkness'; that part has always reminded me of the Marseillaise, which I took as a musical joke aimed at 'All you need is love'. If so, then I am prolonging the joke. I don't know whether the casual listener would be aware of the quote; at the moment, my ears are sensitised to this lick and so it stands out.

Due to my illness, I have yet to record a vocal, although paradoxically the sound emanating from my throat might sound better than my normal singing voice.


Friday, March 16, 2012

Rubber duck debugging

I was reading yesterday about Rubber Duck Debugging, in the context of Stack Overflow. The scenario, which has happened to me several times, is as follows:
  • Programmer is stuck
  • Programmer writes a description of the problem to a help desk
  • Whilst writing the description, the programmer realises what the problem is and how to fix it
  • Programmer deletes the letter to the help desk
I went through a version of this today; following is the background. For one customer, we have to print sticky labels with identifying details on the label (this of course is not a problem). The problems start when one of our factories produces three sub-assemblies which together make up the part which the customer ordered. My program was printing three labels (so far, so good), but I was asked to serialise them (which means printing on the first label 1/3, printing 2/3 on the second label, and 3/3 on the third label).

The external program which we use to print the labels has the capability of serialisation, but this is slightly limited. Let's say that I had to print two labels for one part and another two labels for a second part. The labels should bear the tags 1/2, 2/2, 1/2, 2/2. Unfortunately, the external program was printing like this: 1/2, 2/2, 3/2, 4/2. No matter what combination of flags I tried, I was unable to print what I wanted.

Then I called the help desk - they noted my details but promised nothing.

Thinking about the problem a little more, I came to the solution. The ERP program was inserting into the 'labels' table two rows, where each row was to be printed twice. The simple fix was to insert into the table one row for every label to be printed, where each row would be printed once. I also included the total amount of labels to be printed for each part (I know that this is a seriously muddled explanation, but all will soon become clear). Now I get the results that I want.

Before:
Part numberQuantity
1232
5672

After:
Part numberQuantityNumeratorTotal
123112
123122
567112
567122

All I needed was the metaphorical (apocryphal?) rubber duck in order to look at the problem from a slightly different angle and so find the solution. All of these problems (like the Excel comments problem which I wrote about the other day) seem totally trivial after they have been solved, but they are very confusing beforehand.

Thursday, March 15, 2012

Sequencing "Lost" / 2

I had some spare time recently so I thought that I would try to record some vocals for my version of Peter Hammill's epic song "Lost". We had three power cuts on the first evening when I tried recording (there was a ferocious storm raging outside) and most of what I recorded was not worth keeping. After an hour of frustration, I realised that fate was against me and so abandoned any further attempts.

I had another go at recording the vocals last Saturday, in a break from revising about negotiation. The only conclusion which I had made from my previous abortive session was that the song was too slow; I increased the speed from 80bpm to 84bpm, which may not seem much but made it much easier to sing.

I then proceeded to record an almost complete take, only to stumble over the words in the final verse. So I recorded the final verse again, mixed the two together, deleted the original .... and discovered that I had muted the almost complete take, resulting in a composite vocal of the last verse only. Gnashing of teeth. This first take, however, served to warm up my throat, and and I recorded a complete second take shortly after, complete with minor sound effects such as the dog barking, my stomach growling and what sounds like the door to the balcony being opened. I was able to silence most of the dog's barking and my stomach; the aural artifacts that remain can only be heard when the vocal is soloed in the mix.

I have begun using pitch correction software - I have a tendency to sing about half a semitone flat - and it seems that this program can't handle lengthy files (the take lasted about 10 minutes, which means that it was about 50 MB in length - recorded in mono). At first I wasn't sure what to do, but later I had the idea of copying the original vocal file into several sections (carefully noting the offset of each section from the file's beginning), correcting each section  and then stitching the five resulting files back together. This plan worked admirably, although every file started playing a few milliseconds too soon; moving them in time was easily achieved.

Once I had all the pitch corrected files playing at the right time, it was only a small matter to create a composite file (without deleting the originals!) which became my master vocal take for compression, eq and reverb. As usual, it was very difficult to find the right eq settings; I have been using a new microphone which supplies completely different tonal qualities to my previous one and I have yet to settle on standard equalisation settings. Eventually I decided to add a strong treble boost which provides a nice sound - it doesn't sound very much like me, but that's not too important. I always find mixing vocals and music very hard; I work on it for an hour, create a finished mix, do something else for an hour and then return to the mix.

I finally settled on a mix which satisfied several rounds of listening (each time lowering the level of the vocal); I uploaded this to a file server and notified the PH mailing group. So far, the response has been encouraging; those that have commented have noted that my arrangement is different but interesting (including the vocals).

This version can be found here.

Of course, after having uploaded what was supposed to be the final version, I had some more ideas which I have yet to check. One of them involves playing the tune to a later Peter Hammill song, 'Masks'. There's an instrumental lick played at one point which reminded me later of 'Masks' and changing the lick to the 'Masks' melody should be simple - although it will involve a slight harmonic change. Another idea involves inserting a few more bars into an instrumental break in order to enhance the dynamics - I don't know how this is going to work yet. It will also involve adding some silence into the vocal file. Normally I don't care for the 'digital razor blade' but adding four bars of silence (at 84bpm, 16 beats should last 11.429 seconds) shouldn't be too difficult.

Tuesday, March 13, 2012

Post mortem on the Negotiation exam

If I am ever to be found walking the Tel Aviv boulevards on a sunny, spring day, with only happy thoughts in my mind, then it's a sign that I've completed another exam in my MBA course. Today's exam was on Negotiation, a subject which I don't seem to have written much about. Almost all of the lectures were held in December/January, leaving us six weeks in which to forget the material. About three weeks ago, I started revising, and I was pleased to note that I remembered most of the material. Since then, I've been working on specific points and looking at previous exam papers, in order to see what is required.

The exam is structured in the following manner: the opening case study has five small questions, each worth eight marks. After that, there are three essay questions, each worth twenty marks. The first three questions regarding the case study are almost always the same, so these can be learnt by heart, although obviously the data has to come from the case study. The latter two questions come from a slightly wider pool but these also can easily be memorised.

And so it was today: the case study was about a French company contracting with a British company who would provide training courses. A day before the agreement was to be signed, the French company sent an email which basically reneged on all the terms of the agreement. What are the interests of both sides? What are the negotiating issues? What is Negotek and how can it help? These questions were like an arcade game: I wrote the answers and could hear in my mind how my score was steadily increasing, ching ching! The fourth question was about the email - a clear case of closing stage manipulation to my mind. I wrote about this subject at a deeper level than the previous questions, ching ching! The final question of this section was about each side's BATNA (Best Alternative To a Negotiated Agreement) - also easy, ching ching!

The first essay question required us to contrast Fisher and Ury's "Principled Negotiation" with Kennedy's "four stage plan", specifically in the context of negotiations between management and workers in a factory about a pay rise. Since I had gone over the four points of F&U with a fellow student five minutes before entering the exam room, this material was extremely well known. Ching ching ching!

The final two questions were slightly awkward in that in first reading, it wasn't clear what they were about. After reading them through a few times, I noticed that the clue to both was in the final sentence. Unless I am very much mistaken, the penultimate question was about constructive/destructive behaviour (Carlyle and Rackham), whereas the final question was about the ten ways to making decisions. I wouldn't say that the arcade game was going ching! ching! ching! as I wrote my answers, but I should have done well on these questions.

Summing up, it looks like that I did very well on this exam, which would be somewhat ironic as it is a subject not close to my heart. On the other hand, appearances can be deceptive and the examiner may be more balanced regarding my mark. I'll know in about six weeks.

All that is left is Strategic planning.....

Monday, March 12, 2012

Proposed doctorate

After posting my previous blog, I realised that I hadn't updated my readers why the tags for it were DBA (Doctorate of Business Administration) and ERP (Enterprise Resource Planning). I wrote about a year ago about working towards a doctorate, where my subject was to be areas in which the classical model of ERP fails. But after a few months of cogitation, I concluded that I was able to find solutions for these areas of ERP failure, and so I needed to find a new subject.

This wasn't too hard as I shortly came across an article entitled Attack of the killer spreadsheet which was very much aligned with my own thinking. To quote some of the article,
The really important thing to remember about spreadsheets  is they are not the companies ERP system. The company ERP/MRP system must always remain the backbone, the main data repository, the source for management information and where business transactions and processes are recorded and tracked.

But what’s wrong with spreadsheets – I hear you ask? Well, the way most spreadsheets are configured means that they miss fundamental (and critically important) ingredients that most ERP’s are equipped with out of the box!

Improper use of spreadsheets often stems from a perceived lack of functionality within the ERP system or a work around where the ERP logic isn’t aligned to way the company wants to operate. Often the easiest, or the perceived easiest, method of fixing that is to “plug” a spreadsheet in to solve the problem. We’ve all seen these out in the field and their function can vary from a simple list (my ERP doesn’t record all the data I need) to acting as an EDI interface between a customer and supplier ERP system.

On this basis, I put together a doctoral proposal, part of which currently reads as follows:
ERP programs are packaged with reporting systems of various level of complexity and capability; these systems are normally based on SQL (Structured Query Language), a database computer language designed for managing data in relational database management systems. The use of SQL is normally the province of IT professionals who configure and support the ERP programs; the end user is dependent upon the professionals and rarely has the ability to create reports of her own within the system.

In order to circumvent this inability – and for other reasons – the use of Microsoft Excel is prevalent within organisations using ERP. The use of Excel can both help and hinder the effectiveness of ERP systems: "when employees use spreadsheets, they create the very problems that ERP systems are meant to address: silos of data, inconsistent information, manual tracking of information and broken business processes".

I propose to investigate the use of Excel in organisations using ERP in an attempt to determine whether Excel does indeed help or hinder; it may well be that certain functionality helps whereas other functionalities hinder.

I propose to ascertain this by conducting interviews with users of ERP/Excel. The majority of the interviews will be conducted with users of the Israeli developed Priority ERP system, as I am most familiar with this product. I intend, however, to conduct interviews with users of ERP systems such as SAP, Baan and Kav (another Israeli product). I also intend to conduct interviews with Priority users in Britain and possibly other countries. These interviews will enable me to determine whether the efficacy of Excel depends on the user's level of sophistication (and knowledge of her ERP system), on the ERP program or on the national culture.

So, whenever there's a blog entry about someone intending to do something in Excel and me suggesting that they do that something in Priority, know that this is connected with my (proposed) doctorate, hence the DBA tag.

Although I have applied to the DBA programme at Heriot Watt University, I have yet to be accepted, as the accepting committee will only discuss my application after I complete my MBA degree.

Another example of Excel usage

My company frequently sends chairs as examples to customers; the customers can use the chair for a period and in so doing 'get a feel' for the chair. Hopefully, a sale will result from this trial period. Even more hopefully, we will collect the example from the customer. Unfortunately, we don't have a very good record for collecting, although that has been improving lately.

Each example is sent with a delivery note; Priority (our ERP system) can track the delivery notes and can also determine which examples are still extant, yet to be returned. Today, those who are supposed to be collecting the examples decided that they would improve their performance by keeping a record of their contacts with customers who have extant examples.

I was asked how they could create the non-returned examples report in Excel; I explained how to do this. Then I was told that they intended to add comments about each example within the spreadsheet. The red light above my head immediately turned itself on.

Looking at the delivery note screen in Priority, I saw that there was an accompanying 'task log' screen which could maintain all the comments for each delivery note. The existing report would need to be modified to add the new data, but that would be a trivial matter. 

So, instead of a spreadsheet which might be passed from hand to hand, which everyone can edit (but no track is kept of who added what), which might get lost, damaged or exist in several versions, we now have an elegant database report which contains the same information, is accessible to all, has its changes logged, will always be up to date and will never be damaged. The user has to perform the same amount of work (if not less) to add the comment to the database. As far as I am concerned, this is an all-around win situation.

To be fair, my solution was enthusiastically accepted and adopted.

The solution this time was trivial, but that's not the point. The point is that when something has to be documented for the first time, people automatically think of using Excel! Of course, Microsoft  don't get a royalty for every spreadsheet which gets opened, but they must be pleased at the amount of market penetration that their product has achieved.

Thursday, March 08, 2012

House with no door / 2

I've been very tied up with family problems in the past week and will probably continue to be tied up for another week so I haven't got much time nor mental energy to devote to blogging. I do have enough time and energy to blog this scrap, though.

Continuing the discussion about the authorship of 'House with no door', I had occasion to look at the cd sleeve and the songwriting credits, which are as follows (original orthography)
Killer (Hammill/Banton/Smith)
House with no door (Hammill.........Jackson)
The Emperor in his war room (Hammill)
Lost (Hammill)
Pioneers over c (Hammill/Jackson.........Band)
As we know that Killer was definitely a joint composition, one can assume that the use of the slash (/) means that the songwriting credit is shared - thus 'Pioneers' was definitely written by Hammill/Jackson. One can assume that the use of the ellipsis (.....) indicates an arranging credit: thus 'Pioneers' was written by H/J and arranged by the band. Hence 'House' was written by Hammill but 'arranged' by Jackson - this is how his instrumental woodwind arrangement was credited.

Saturday, March 03, 2012

Incremental search in a combo box

Lately, I have increased the use of combo boxes in my programs and it has come to my attention that I sorely need incremental search. A standard combo box finds strings according to the first letter only - if the user presses 'b', then the combo box finds the first string which starts with a 'b', but should the user then press 'r' (let's assume that he's looking for 'brian'), the combo box jumps to the first string which starts with 'r'. Incremental search would cause the combo box to find the first string which starts 'br'.

Obviously some functionality has to be overloaded, but it's not clear exactly what. Googling doesn't bring up many possibilities; here is one of the more complete versions which I found.

procedure TMainForm.DocEntryCBEnter(Sender: TObject);
begin
 GS := '';
 GCOUNT := 0;
 TComboBox(Sender).ItemIndex := 0;
end;

procedure TMainForm.DocEntryCBKeyPress(Sender: TObject; var Key: Char);
begin
 AutoMatch(TComboBox(Sender), Key);
end;

procedure AutoMatch(cbo: TComboBox; var keyascii: char);
var
 sbuffer: pchar;
 s: string;
 retval: longint;

begin
 getmem (sbuffer, 255);
 if Keyascii = #8 then
  begin
   dec (GCOUNT);
   s := copy (GS, 1, GCOUNT);
  end
 else
  s := copy (GS, 1, GCOUNT) + (Keyascii);

 try
  strpcopy (sbuffer, s);
  retval := sendmessage (cbo.Handle, CB_FINDSTRING, word(-1), longint (sbuffer));
  if retval <> CB_ERR then
   begin
    cbo.ItemIndex := Retval;
    GS := cbo.Text;
    Inc (GCOUNT);
    Keyascii := chr (0);
   end
  else
   begin
    messagebeep (0);
    cbo.Text := GS;
   end;
 finally
  freemem (sbuffer, 255);
 end;
end;
Whilst this code includes some nice ideas and looks impressive, it transpires that there are several lines which are inefficient and a few which are simply wrong. At first, I thought that the AutoMatch procedure ought to be part of the DocEntryCBKeyPress code, but it is written cleverly in such a way that it can handle a multitude of combo boxes - or not, as the accumulated string gs would be common to all the combo boxes, when in fact it should be separate.

The first inefficiency is creating a temporary buffer of 256 characters every time the user presses a key (this is the call to 'getmem'). Why not create a permanent buffer for the combo box in the same way that the variable gs is created? But why even do that? This buffer is only required as a parameter to the SendMessage, and it seems that the writer had only an incomplete knowledge of type casting - whilst he type casts the pchar (sbuffer) to a longint (as required for the fourth parameter of SendMessage), he could also have typecast the gs string to a pchar - thus obviating the need for sbuffer, along with its allocation and deallocation.

It also seems that the writer had never heard of string concatenation - he can simply add the new keystroke to the accumulated string (gs) without having to use the 'copy' function.

There is an error in the line which handles the 'backspace' keystroke (#8): should the first key to be pressed be backspace (however illogical this may be), gcount will logically receive the value -1, which will probably be rounded to 65535. Instant memory problems!

The other mistake which I found only became clear after using the code - let's say the user presses 'b' (whilst looking for 'brian'). The call to SendMessage will succeed; the line cbo.ItemIndex := Retval means the combo box will display the first string which starts with 'b' and then the accumulated string is set to this value. Let's say that the found string was 'Bobby'; now the accumulated string will be 'Bobby'; when the user presses 'r', the accumulated string will now be 'Bobbyr', which presumably will not match anything!

My code looks like this:
Procedure IncCBKeyPress (cb: TComboBox; var key: char; var fsaved: string);
var
 retval: longint;
 len: word;

begin
 len:= length (fsaved);
 if (Key = #8) and (len > 0)
  then setlength (fsaved, len - 1)
  else fsaved:= fsaved + key;
 retval:= sendmessage (cb.Handle, CB_FINDSTRING, -1, Longint(PChar(fsaved)));
 if retval <> CB_ERR then
  begin
   cb.ItemIndex:= Retval;
   key:= #0
  end
 else
  begin
   messagebeep (0);
   cb.itemindex:= 0;
   fsaved:= '';
  end;
end;
I've changed the variable names slightly - what was gs has now become fsaved. This is in preparation of creating a new TIncComboBox component. This code can definitely be shared between several combo boxes as the accumulated string is passed as a parameter.