Sunday, April 27, 2008

Heatwave

Israel was gripped by a tremendous sharav (hot wind) during the past week. Fortunately, I was at home all week and so didn't have to work in an office without air conditioning. One morning - I think it was Thursday - the temperature was 30 degrees centigrade at 6 am! Here is a picture which I took of our barometer, which shows the temperature both outside and inside:


This rather crude picture was taken with my mobile phone with bad lighting; the top line shows the outside temperature and the lower line the inside temperature (if you look closely, you can see my reflection at the top). My wife doesn't believe me when I say that apparently it was 46.3 degrees outside! The remote sensor is not supposed to be in direct sunlight, but even so.... I've never seen a temperature as hot as that before. For those of you in the Fahrenheit system, that's 115 degrees!

Fortunately, at about 5pm, the temperature starting dropping ... and dropping ... and dropping. Friday was fairly normal, reaching a high of 31 degrees at about 2pm, but again by late afternoon, the temperature dropped to a reasonable level. Yesterday (Saturday) was wonderfully cool - a high of maybe 25 degrees, and today is similar. It seems that the heat waves are over for a period of time.

We're off to Amsterdam for a few days starting Wednesday morning. Maybe I'll add an entry from there.

Tuesday, April 22, 2008

Holiday week

It's Passover week, and my company has decided to close down, forcing everyone to take four days holiday. Some people are only too delighted to do so (one man was telling me how he is taking his entire family to Eilat for the holiday, which makes life much easier on his wife), whereas I tend to find little to do during such weeks.

I have been buying via e-bay dvds of the excellent British series "Cold Feet" for very low prices, and so this week has been an opportunity to watch them. I have the entire series on videotape, but I don't think that I've ever watched all of them in continuity (although I did see all the episodes twice on tv). There is a limit to how much emotion one can take in a day.

Regarding the computer, I haven't been doing much programming at home in the past few weeks as my psychologist friend has been on holiday. I thought that I would get back into the swing of things yesterday by programming a quick demo of something that we've been talking about but has been left aside as there have been more important things to do.

Then popped into my head the idea of writing a command line interface (CLI) for the databases. I use Borland's "Desktop database" program, but this is concerned primarily with describing a database (ie defining the tables in the database and defining the fields within each table) and
the possibilities of editing the data are very limited. I wrote a program which allows me to do three different kinds of operation:
  • meta-queries (list of tables in database, structure of table)
  • 'select' queries, which can be simple ones about one table, or complex joins
  • updates and deletions
Basically the program consists of a text parser and an sql engine; if the first word in the text stream is one of those connected with a meta-query, then the program executes this command. Otherwise all the text is passed to a 'query' component which is then executed and the results displayed.

The whole thing took about two hours to write and works well enough for what I need. The parser could do with improving, which is hardly surprising as it was written ad hoc without any prior thought, but it's ok. As it's only for my use, I'm not going to bamboozle it with improper commands.

Anyway, the reason for this program is that the demo which I wrote requires that values within a field in one of the tables be changed. Instead of doing this manually via Desktop Database, or writing a program which executes the 'update' queries, I thought that this CLI approach would be better as it is of course re-usable.

Monday, April 14, 2008

Visiting the vet

We took the dog to see the vet yesterday. My wife was worried about a little bump by the dog's right ear, which turned out to be nothing. While we were there, the dog also underwent treatment for worms (trying to force pills down her throat), vaccinations for rabies and other dog ailments, and a general checkup.

We discovered that Mocha (aka the hound of the Baskervilles) weighs a mere 40 kg; the poor vet had to lift her up whilst weighing himself so that we could determine this (in order to know how many anti-worm pills to give).

We also left behind a fair amount of the national debt.

Here is the dog herself in all her glory:



One gets an idea of her size when one considers the size of the couch behind her.

The photo was taken from my new (as from February) mobile phone, a Nokia 6288. At first, I really hated the phone, as I couldn't get it to do anything. The manual seemed worse than useless, as it told the user all kinds of information, everything but what I wanted to know. But after a while, things settled down, and I started to learn how to get the phone to do what I want it to do.

As I have reading glasses, I find it difficult to see who is phoning me when I'm not wearing the glasses. I discovered that I can take photos of people and then attach those photos to the person's contact record; now, when someone phones, I can see their picture and so know who is calling.

The phone also has a video call function which seems like more of a gimmick than anything else. I tried it with someone in the next cubicle, and it worked well enough, but of course it only works with other phones that have the same option. My son was always ragging me about my previous mobile phone, which admittedly was a very old model (but good enough for me). Even though he too has had his phone updated, he had to admit the other day that my phone is much better than his.

A mobile phone is one of the few items about which a man is prepared to brag that "mine is smaller than yours". With this new breed of phones, it seems that this trend is actually reversing.

Sunday, April 06, 2008

The night of the long knives

After a period of expansion, my company has needed to rein in its expenses by a certain extent. In the IT department, we've been spending money left, right and centre, most of which went to a central storage facility which was greatly needed. For the time being, our budget is being cut; this isn't too bad as some of the work which I am doing used to be farmed out to consultants at a non-trivial price. In fact, for years I've been trying to measure my work as a function of how much money I save.

But that isn't really what I wanted to write about: another source of saving is making people redundant. One group of people is being replaced by a sub-contractor (what we would call 'outsourcing' in the computer industry), whereas others are simply being sent home. Of the names that I have heard, several have a very low return on investment index (in other words, they don't contribute very much but cost a lot) and so by letting these people go, the company won't lose much productivity whilst saving money.

The most painful cut is that of a close colleague of mine, a young lad of 64. In the pre-merger days, he was one of the most important figures in the company, but since then his job has been continually downsized until now he too is costing a fair amount of money whilst contributing less. I say that he is "geographically challenged": had he be living in a different city, where his group's activities are based, then possibly he wouldn't have been the one to go.

Such acts of making people redundant cause fear and worry throughout the company. Everyone starts wondering whether they are contributing enough compared to their salary. Will there be more redundancies? What would I do if I were made redundant?

Someone came to talk to me this morning, another spring chicken of 60+ years. He was worried that he too might fall under the axe. I tried to convince him that as far as I see things, he is an essential person, even more essential than I am. Anyone who fired him would be committing business suicide.

Making people redundant might save a certain amount of money in the short run, but it tends to be a counter-productive move. The amounts saved are normally not very much, especially when compared to the savings which could be made by getting an additional 1% discount on all raw material purchases, for example, or decreasing the discounts which are given to customers.

Wednesday, April 02, 2008

ERP

I know that ERP means "enterprise resource planning", but in my case, it appears to mean "Enhanced Rate of Programming". I find that in terms of programming within our ERP system (writing 'straight' reports, writing complex reports, defining new tables and fields, screens and triggers), I find that my productivity is increasing by 25% a month (hard to quantify, but let's assume). I know that yesterday I programmed a trigger using a technique that I thought that I didn't know five minutes before I attempted it. Such an idea would never have occurred to me a week ago or a month ago. A year ago, I wouldn't have known what I was talking about.

Maybe ERP means "Exponential Rate of Programming" - 1.25 raised to the power of 14 gives the astonishing total of 22.7. This means that I am at least 20 times more effective than I was a year ago!

I wish that my pension fund would yield the same rate. The last eight months have been very disappointing, and it's heartbreaking to deposit good money into an investment fund only to see its value decrease. At the moment, it seems better not to invest.

Yesterday I devoted an hour to cataloging all these blog entries. It wasn't surprising to find that programming and MIDI are hot subjects here. What was interesting was to read posts from a few years ago, especially one written about this time. I was writing about Maccabi Tel Aviv basketball team and how they managed to get to the Euroleague final, despite not playing too well during the season. This year has been the same story; true, they haven't got to the final yet, but have a very good chance of doing so. Being one game up in the quarterfinals with homecourt advantage, they should get to the final four, and then everything is up for grabs.

Injury problems have caused many problems, and there seems to be big problems in filling certain positions. Yet Maccabi keep on winning (at least, winning the games that matter). It would be very interesting to hear commentary on one of their games from their opponents' point of view, but alas, such opportunities do not arise.

Monday, March 31, 2008

Lots of things to do

I received a package from Amazon a few days ago, containing the following
  • "Trisector", the new cd by Van der Graaf Generator
  • two Rebus books written by Ian Rankin, "The Falls" and "Exit Music"
  • one book written by Brian Viner about his life in the countryside
  • one book about cognitive therapy, called "Feeling Good" (or similar)
I am slowly working my way through the package for I have several activities competing for my spare time, to wit:
  • writing and updating programs for my occupational psychologist
  • taking the dog for long walks
  • writing important letters
  • watching films which have accumulated
Last year on the way to Santorini, I bought a dvd machine which records as well as plays, and so I've found myself recording several films a week. One ridiculous weekend not so long ago had me recording 6 films over 24 hours, as the satellite company showed good films in the run-up to the Oscars. I've had a look at this week's schedule, and there are "only" five films in the entire week which I want to record. Anyway, the machine has been fritzing for quite some time: I can record properly and finalise the discs, but when I put them back into the machine in order to watch them, the machine refuses to recognise them (even though the discs are readable on the computer). On Saturday the machine stopped initialising and so I knew that it was time to take the machine to be repaired. I had taken it a few weeks ago when it started acting up, but the technicians said that there was nothing wrong with it. This time there was no argument, and the laser within the disc drive was replaced. So far I've managed to watch 45 minutes of "Shirley Valentine", and today the machine will have its first real test when it is supposed to record "Local Hero" (one of my top films; my wife can't watch the bought version because it doesn't have Hebrew subtitles) via timer this afternoon.

Anyway - I have all these films taped - but I've only seen part of them. One needs personal time to watch and enjoy them.

Israel moved onto Summer Time on Thursday night, which means that it doesn't get dark until after 7pm. As a result, I can now take the dog for long walks after I get home from work; previously there were days when we could only manage a swift walk around the block before darkness fell. These walks take between 45-60 minutes, and whilst they give me physical exercise and a chance to unwind, they also take time.

I've been working very long hours this month writing programs for the occupational therapist. One exam has been converted for use externally - that is, we put it on the Internet, from where companies with which we are in contact can download and then administer the tests in their environment, sending us the raw results. The first thing which I did with the program was to convert it from using the BDE to using a resource stored stringtable, in which are stored all the questions, as well as various strings which are displayed on the screen. We are hoping to have the questions translated into different languages (Russian is the major target), and now the program can easily support this. Another problem which we encountered the other day was that the program cannot be run on a mobile computer (well, of course, it can be run, but the user interface depends on pressing keys on the numerical keyboard, and a mobile doesn't have these keys). Letting other people run this program tests it properly.

We are also developing an aptitudes exam, which has caused me to learn new things (like how to store a JPG image in a database and then display it) as well as looking at these programs in a new, more abstract, light.

Our flagship product, the program which reads and evaluates users responses, is continually undergoing changes. The output is becoming more and more sophisticated, and now we are tailoring it for the specific needs of external companies. These results, simply put, give a psychological profile of the person sitting the exam; initially they were used for communal settlements wanting to check whether prospective candidates would make successful settlers, but now we are trying to move into the business market, and so are trying to tailor the results so that they fit into a business orientated mode. We have added - on the basis of existing data - filters and aggregates to check how a candidate does in specific areas of management. Whilst the base of the program - and the exam - remain unchanged (and have to, in order that the statistic analysis which resides at the bottom layer is unaffected), I am constantly adding new tables in order to handle new ways of looking at the data.

I also realised the other day that I could combine several tables, each of which contains only an id and a name, into one table, containing id, name and type. I can't do it now, as those ids are not unique and of course are scattered amongst other tables, but if I find myself having to add a new table with an id/name tuple, then I will extend one of the currently existing tables. This is the approach which I used in the aptitude test, when we decided to store each examinee's occupation and educational level. Keeping a separate table for five or six entries has a high overhead.

So now it becomes apparent how little time I have for reading books. More about them later.

Sunday, March 23, 2008

Clarification

In my previous entry, I wrote "Israeli youth do not read Orwell or Eliot in school; they read the Bible (in what seems to me to be the least most important subject, even less useful than trigonometry)."

I didn't mean to give the impression that the Bible (old testament) is less valuable or even less literary than Orwell or Eliot, although that is exactly what I did. If my fellow workers would quote the Bible at appropriate moments, then I would be pleased. But it seems that the Bible is taught more as a historical story and less of a moral approach to life, and that's why fewer people quote it.

If someone can find a reference which will help us in purchasing strategies, I would like to be the first to know.

Teaching at schools seems to miss the point frequently. The point about trigonometry is not the trigonometry itself but the fact that it introduces new mathematical tools into the student's toolbox, a new way of looking at the world. As I frequently say when I see Excel being used for something for which it is not the appropriate tool, "when the only tool you have is a hammer, every problem looks like a nail". Schools are more geared to teaching the students the specific knowledge, instead of training them how to generalise the knowledge in the hope that they might use it in a completely different situation.

I was going to write "Literature informs computer science - how quaint!", but then I remember that in Stephen Levy's book about the Macintosh, "Insanely Great", the developers (especially Jef Raskin) did exactly that - look to literature and art in an attempt to improve their product, and make it more "human" as opposed to more "computer".

Another example: I was explaining to someone the other day how modular our ERP program (Priority) is, and how there is very little "program" - all the screens and all the reports are actually defined in database tables, and the "program" loads these screens or runs the reports as necessary. Thus it is virtually indefinitely extensible. One day later, I was talking with my occupational psychologist about the 'aptitudes' program which we have been developing, which contains several different mini-exams (finding the odd one out, vocabulary, etc). I had only developed a very early - but functional - version of the program, in which every mini-exam had its own table (and structure), its own data entry screen and its own exam screen. She wanted to extend the program without me having to add infrastructure, and then it occurred to me that I should write the program in the same vein as the ERP - allowing the administrator to define new exams, to enter the questions and even display them in a modular structure. I spent most of yesterday doing that.

Friday, March 21, 2008

Literary allusions

I sometimes wonder whether my colleagues at work think that I'm a little weird. Instead of talking about football or the wonderful dish I cooked the other night or even work, I tend to insert little pieces of culture which seem to come from nowhere.

People's ringtones are a rich source of information to be shared. Yesterday I found myself telling people about the pentatonic scale after hearing someone's Japanese sounding ringtone, and indeed my own general ringtone is a souped up, syncopated version of Eric Satie's "Gymnopedie" (which I got from a colleague who simply thought that it sounded nice). I actually bought a disc of Satie the other day, which I find quite pleasing and relaxing, although I must admit that I prefer a chamber orchestra to solo piano.

During a discussion about stock control and purchasing strategies, the immortal words of George Orwell suddenly entered my head.

He who controls the present controls the past
He who controls the past controls the future

How apposite! One part of the purchasing strategy looks at the average use of raw material over the past few months, the number of months being variable. Normally it's six months, but I could change this. He who controls the present controls the past - changing this variable can cause changes in the average use, especially if it's a new part. Future orders in part (excuse the pun) depend to a certain extent on this average, and so he who controls the past controls the future.

As usual, no one knew what I was talking about.

Another pair of quotations from '1984' also finds favour in these quarters, especially when talking about databases and user privileges:

Knowledge is power
Ignorance is strength

Most of the time I don't actually express these literary allusions but keep them to myself, because I know that most lack the references. Israeli youth do not read Orwell or Eliot in school; they read the Bible (in what seems to me to be the least most important subject, even less useful than trigonometry). As opposed to earlier generations of British schoolboys, I didn't have much Shakespeare forced upon me (that's why I was reading Orwell or Eliot), but I did pick up a little S, here and there. Playing The Young Cato in our school's production of "Julius Caesar" made me appreciate his language much more than trying to read his unpenetratable plays, but Israelis read even less than I did (although I think that all of S's plays have been translated into Hebrew). References to Brutus tend to fall on deaf ears, although people do know about knifing in the back.

Possibly I read '1984' and its soulmate 'Animal Farm' too young. I know that I was genuinely frightened by these books, both by the physical violence displayed in the former, but also in the latent violence present throughout. The thought that people could change their ideological outlook overnight is something that dismays and frightens me to this day - and in a way, I've been a party to it myself. I have often compared the ideological switch of the kibbutz movement (from "share and share alike" to "take what you can get") to the overnight changing of allegiances in '1984' (we have always been at war with Eastasia) - but again, few seem to know what I am talking about.

Sunday, March 16, 2008

Chava Alberstein

Last night we went to see veteran Israeli singer Chava Alberstein at the concert hall on the kibbutz. In thirty years of Israeli concert going, I've never seen her before. I'm sure that this is more my fault than hers, although I'm equally sure that she hasn't been performing for the past few years. There are no excuses though when she appears on our doorstop.

Chava plays competent acoustic rhythm guitar; supporting her were another acoustic guitarist playing lead lines, yet another acoustic guitarist who sometimes doubled the leads, sometimes harmonised the leads and sometimes played supported the rhythm. There was also a percussionist who made interesting sounds on a variety of instruments. I very much enjoyed the first ten or fifteen minutes of the show but then it began to pall, basically because every song started to sound the same. A ray of sun shone through the clouds when the percussionist suddenly played a few notes on some kind of marimba (I couldn't see as for me he was positioned right behind Chava).

A highlight of the first part of the concert was an acapella song (accompanied only by percussion) which worked on three levels. First of all, the song itself - an observation of paranoia whilst in passport control - was witty; secondly, the singing was divine; and most important, the stark nature of the song broke up the boring dynamic which had been established, and enabled the audience to refresh their ears.

After this song, the band went electric - one guitarist took up an electric, the other a bass and the percussionist went to trap drums. The result would have shamed an average garage band. They weren't bad, but they weren't very good. The drummer, who uptil now had been fairly impressive, was very limited on the kit, whereas the guitarist preferred twiddling around in a fruity tone which didn't add much. The bassist was almost inaudible.

Fortunately, this assault on the senses ceased, and then the third part of the show began, again in acoustic mode. The final song was one of Chava's most famous - and most moving - "Like a wild flower", the tale of a girl who finds herself as an outcast in kibbutz society and decides to leave.

The whole concert could be viewed on several levels, each with a different mark -
  • the songs - generally of a high quality
  • the singing - excellent (and let us not forget that Chava has been performing for 40 years)
  • the arrangements - good, up to a point
  • the dynamics - non existent
  • the phrasing - four to a bar and very disappointing
The final, unaccompanied, song was actually a microcosm of the problem. Being a song which the entire audience had waited to hear, they all joined in. The phrasing of the first verse was very much on the beat and very standard. But by the time the third verse had come around, very few of the audience were still singing (maybe they don't know all the words), and syncopations were finally happening almost every line.

The rhythmic aspects of the evening were also disappointing. One waltz, one song which might have been in 12/8, and the rest in fairly straight-forward 4/4. No sambas, no bossa novas, no syncopations and no variations. No wonder I felt bored after fifteen minutes.

For the weeks prior to the concert, I had been wondering whether I should try and approach Chava after the concert. Several of her songs had meant a great deal to me in earlier days, but I haven't really listened to her in the past twenty years, and I know that performers are much more interested in what they are doing now rather than some forgotten song from 30 years ago. The solution came to me one day when I was walking the dog and listening to cover versions of songs which I had recorded. One of those songs - and in fact the only song which I have ever recorded in Hebrew - was a song which Chava made famous, albeit in 1975. I decided to give her a disc with that one song on it, along with a letter telling her how much some of her songs had helped me learn Hebrew all those years ago. This way I wouldn't have to talk to her.

And indeed I didn't talk to her. When my wife and I ascended the stage (as we do after most of the concerts to say a personal thank you to the performers), we were stopped by some official character who took my package and said that he would make sure that Chava got it. So much for all the indecision whether I should have my picture taken standing next to her. My email address was included in the letter, but I'm not going to hold my breath waiting for a reply.

Back to blogging

I haven't been here for a while, for various reasons, most of them totally uninteresting (like two weeks of flu). When I did decide that it was time to start blogging again, I was cut off out of my account and couldn't remember the password. No problem, says Blogspot/Google: press here and we'll send a letter to your email account giving instructions.

Yes, well the letter did indeed arrive but was coded in some strange unreadable language. All attempts at turning it into something recognisable failed. So I tried several different pages at Google in an attempt to rectify the situation, and eventually one sent me a readable email with a link to a page which enabled me to reset the password. Obviously, as otherwise you wouldn't be reading this.

Most of the last few weeks have been spent furiously coding, either at work in our ERP system, which is slowly but surely yielding to my wishes, or at home in the second job. Lately I've been working a lot on Word Automation; it's a subject which isn't covered very well, especially not for someone working in Delphi. I have to read the information contained on several different sites in order to get working code, and even then it's still a process of trial and error to get something that I want.

I've just learnt how to automate tables, and more importantly how to get them to autosize. The result is quite attractive.

Monday, January 28, 2008

Brains and mirrors

Last week I caught the tail end of a programme screened on BBC Prime about the function of the brain. This is a subject which has interested me for the past few years, so I made sure to arrange my schedule such that I could watch the programme last night. Three main points were introduced during the episode:
  1. Babies upto the age of six months are able to recognise and differentiate between the faces of primates (lemurs were the animal used) as opposed to babies over the age of nine months
  2. First impressions are very important
  3. Humans learn to read people's expressions and so try and understand what other people are thinking. In so doing, we mirror their body language
The moral of the first point is "use it or lose it". According to the brain, a baby has 1.5 times the amount of synapse connections that an adult does, because it has to learn so much. One of the things which it doesn't need to use is the ability to differentiate between primates, and so this ability withers over time.

The second two points are very important and are known collectively as "mirroring". This information was very familiar as I had been reading about it over the past two months in a book called "Social intelligence". The book goes into far greater depth than the programme did, of course, but as they say, a picture is worth a thousand words.

I found this book very interesting for a few reasons. Whilst reading a book by Martin Seligman, I became aware of the fact that my social skills aren't particularly well developed and that this is an area in which I could improve. I looked for something in this subject on the Internet and found "SI"; as it happened, the same evening I was in a book shop and found the exact same book on the shelves (maybe slightly more expensive than via Amazon, although once the shipping is figured in, maybe not) so I bought it. Reading it made me aware how much difficulty I have at times in reading people's expressions, and how my body language is frequently different from my companions (in other words, I don't mirror very well).

When taken to a more extreme level, such problems are one of the features of Asperger's syndrome, and if one continues on the same continuum, one eventually gets to autism. Whilst there is no possibility that anyone could ever consider that I have Asperger's, I do recognise the inability. Knowing about this allows me to do something about it.

The other reason why the book was interesting was that intellectual types like myself need these things spelt out, whereas other, more visceral, people know these things automatically. I also need the intellectual explanation, about mirror neurons and spindle cells, rather than the simplistic explanation as offered by the television programme.

As the programme wasn't subtitled into Hebrew, my wife had difficulty in following it, but I was able to explain the content to her. I was also glad that I was able to talk to her about such subjects as most people aren't particularly interested in an off the cuff chat about mirror neurons et al (Asperger's flag flying).

Tuesday, January 08, 2008

Sleep, part five

Whilst there are other things happening in my life (like our offices moving from where they were to a new site 5km away), most of them are day to day things which most people know about and have experienced. This seemingly narcisstic obsession with my health - and especially with my sleep problems - is designed to help other people who may find themselves suddenly confronted with these problems and would like to hear from someone who has already experienced them.

I've been back and forth to the sleep lab several times. Even though the technicians there are actually employees of companies that sell CPAP machines, they are more interested in finding the right machine and the correct settings to match each person individually rather than simply selling the most expensive machine that they can find.

The original test showed a horrifying 65 breathing episodes per hour; my first week of CPAP reduced that figure to 10, a huge increase. Even so, the technician was not impressed, and noticed that the data showed that air was leaking from the mask, thus causing the pressure to be higher than necessary. He adjusted the mask, and after another week, the data showed only 3.5 apnea an hour, an eighteen fold decrease.

The next session involved changing the CPAP mode: instead of automatically adjusting its pressure, it now works at a constant (and fairly low) pressure. I was waking at least twice a night, and the hours when I awoke corresponded with the highest pressures. Since that change, I have been able to sleep with the mask on all night! I do wake, but I can fall asleep again without too much difficulty. The next problem to be solved is the effect of the mask on my face - the nightly pressure leaves me feeling its imprint throughout the day.

I am pleased to say that I am no longer tired during the day, a sign that the treatment is working properly.

On another subject, I had another dental appointment yesterday. The result of my previous examination was that the crown needs to be replaced (yet again) in order to fit the new shape of the tooth, following the root extraction. So yesterday I had the crown removed (via drilling and demolishing - it doesn't come out easily) and now I have a new temporary crown. In another few weeks the tooth will be examined again and then we go once more through the sickening process of preparing a new crown. I jokingly asked whether I can use the casts of my teeth from the previous time, at least for the lower jaw - anything to avoid the making of casts again.

Monday, December 24, 2007

Sleep, part four

Well, I have my CPAP machine. This consists of a pump and a small mask: the pump sends pressurised air through a tube, into the mask and down into my throat. The pressure has to be high enough to raise the soft tissues which settle on top of the trachea and prevent air entering the lungs.

After another brief consultation with the sleep doctor, I was ushered into another room with a man who I naively assumed was a technician, but was in fact a salesman for one type of CPAP machine. Obviously I don't have enough experience (make that no experience) to know which make of machine is suitable for me, nor which type. He fitted me out with an automatic model, which measures the air resistance coming from my lungs; after a week, they'll download the stored data and decide whether a fixed pressure machine is better (and establish what that pressure is) or whether the automatic model is better. I imagine it will be the latter. Not only is it more flexible, but it's also 25% more expensive. Fortunately I only have to bear between 25-35% of the cost; my health insurance will pay the rest.

Try to imagine what it's like going to bed with a pump chugging away by one's side, blowing air into a tight fitting nose mask pinching one's face. While this is imaginable, try imagining falling asleep with this! As the pump takes in air from the room (and the pump is near an open window), the air is somewhat cold. Basically, the first night was a disaster and I got almost no sleep, until about 2am when I decided to remove the apparatus and sleep "normally", apnea and all.

In the morning, I slunk round to the kibbutz clinic and asked whether the doctor (who was not there) could prescribe me some relaxants in order that I might fall asleep. In the mean time, the nurse gave me some OTC natural relaxant pills based on the herb valerian. The first night (Friday) that I took these pills, I did fall asleep reasonably quickly, only to awake a few hours later boiling with heat (I had left the electric blanket on and my wife had yet to come to bed). Somehow I managed to fall asleep again for another few hours, and then decided to remove the mask. The past few days have followed the same principle: take one or two valerian pills, sleep for four hours, wake up, struggle to sleep again for two hours and then remove the mask and get another two hours sleep.

Last night I was looking at various web sites which said "yes, it's frightening to wear the CPAP mask, and yes, it's difficult to sleep with it" - reassurances which I didn't hear in the sleep clinic. According to work done in Greece, there are definite benefits to be gained from using the CPAP for more than four hours a night, although of course more is better. At the moment I'm using it for four-five hours each night, and I must admit that it's getting slightly easier each night.

The internet articles suggested that there are some machines which are capable of heating the air before it enters the mask. Normally there would be no need for this here, except for during this cold month, and unfortunately that month is my introductory experience.

I do think that I'm less tired during the day, although the road to recovery is going to be slow. My back also hurts, which could be a combination of several factors, including the cold and possible bodily contortions which enable me to sleep "comfortably" with the mask.

Saturday, December 15, 2007

Sleep, part three

I got the results of my polysomnogram back the other day. From a scientific point of view, this is very interesting: there are several graphs each showing differing states on the timeline (sleep state, body state, oxygen saturation and snore volume). From this, I can see that there were times that I thought that I was awake when in fact I was asleep, although the sleep was of low quality.

I'm not too sure how much can be read into the fact that only 25% of my sleep was rem-sleep. I don't know what the usual fraction is, and also one has to bear in mind the unusual circumstances of the test. What is much more important is the number of breathing "events" - these were on average one a minute! Which means that I have severe sleep apnea: no surprise that I am always tired during the day, and often nod off for a few seconds if I'm not doing anything.

I have a return appointment with the sleep doctor on Thursday, during which he will no doubt recommend treatment with "CPAP, or continuous positive airway pressure, in which a controlled air compressor generates an airstream at a constant pressure".

One subject which I intend to bring up is the fact that I often suffer from headaches upon rising on a Saturday. This is particularly annoying as these can often ruin my one day off from work. I remember mentioning the subject to my family doctor, and naturally he asked what was different on a Friday. Now I that mention this, I recall that I blogged on this subject earlier this year. Anyway now I have a different hypothesis. It's obviously not due to caffeine withdrawal, as I don't drink caffeinated drinks (I had to give up drinking tea as it prevents iron absorption). No, I think that the cause of the headache is that I sleep two to three hours longer on Friday night, and in that time, the apnea causes less oxygen to be absorbed. The extra hours of sleep mean that the body has more hours of oxygen deprivation, and that's what is causing the Saturday headaches.

Migraines are a separate subject, and they generally start in the early afternoon. So even if my hypothesis is correct, it won't explain the migraines.

Uncle no longer

As of last night, I am an uncle no longer. Premmie lived for one week and died of complications.

I don't have any details and I'm not too sure that I want to know. Whilst in Victorian times, a lifespan of one week was not uncommon, it's unusual a century plus later. On the other hand, a 600 gram baby would have been left for dead immediately on birth, and it's doubtful whether the mother would have survived either.

To use a modern word, I am gutted - and I'm not even a blood relative. I hate to think what pain my brother in law and girlfriend must be suffering. It was I who advised them not to abort a few weeks earlier, and instead let nature take its course. Little did I know. As the girlfriend (soon to be wife, I hope) is approaching 40, her chances of a safe birth are decreasing daily, although she points out that their troubles began after the amniotic water test was performed.

Sunday, December 09, 2007

Uncle

I have become an uncle for the first, and probably last time.

My wife's brother's girlfriend (WBG) gave birth to a baby boy early on Friday morning, Dec 7. The baby weighed only 600 grams and was born 3 months premature. Of course, at the moment he is in intensive care and will probably stay there for about a month, before moving into the regular premature babies ward.

The WBG announced that she was pregnant a few months ago, which got us wondering when their wedding was going to take place. As I understand it, this pregnancy was not planned, but as she is nearly 40 years old, one takes what one is given. A few weeks ago they called to say that WBG had been hospitalised as she had been leaking blood and amniotic fluid. As the pregnancy was not very far advanced (20-21 weeks), she was placed in an ordinary women's ward, and it was touch and go whether the pregnancy would be terminated. At that age, the foetus is not considered to be viable and so an abortion for medical reasons (in this case, mother's health) is definitely possible.

Our advice was to hang on and let nature take its course. One week went by, and she was sent home. Another few days found her back in another hospital, again a women's ward. The clock was slowly ticking by, and eventually the pregnancy advanced to the 24th week, at which time she was moved into the prenatal wards.

My wife was in such a ward for nearly two months, and our son was born two months premature, weighing 1.2 kg, so we do have some experience regarding these matters. Only this time, the pregnancy was about a month behind my wife's when she was hospitalised.

On Wednesday night, labour pains started, which continued through Thursday, and the birth itself was in the early hours of Friday morning. The foetus had been monitored all through the birth process and was ok, but after he was born, his heart stopped beating. He was quickly resuscitated and placed in an incubator.

I could have written about this on Friday morning, but I wasn't sure that he would survive the weekend. We were in the hospital last night and saw the relieved mother and father. Only parents are allowed into the premature babies ward, so of course we didn't see the baby (yet to be named), although we understand that he is doing as well as he can under the circumstances. A full "systems scan" will be done today to see exactly how well he is doing.

Wednesday, December 05, 2007

Sleep, part two

These are the pictures which I saw on the Internet of someone being sleep tested:





My apparatus was completely different.

I told my family doctor about the experience, and as I imagined, he was not aware of the fact that the test could be done at home.

I phoned the sleep clinic today to discover that they were able to extract enough data from the test, even though I felt that I barely slept at all. This means that I won't have to do the test again, although I have a feeling that the data which was extracted was not particularly representative.

The results are supposed to arrive after about ten days; I'm not going to hold my breath waiting.

Saturday, December 01, 2007

Sleep

This column was supposed to be about spending a night in a sleep laboratory, something that I imagine most readers will not have experienced. Unfortunately, the reality is somewhat different from the dream.

I had an appointment for the sleep clinic in downtown Jerusalem. I arrived about an hour before my appointment, as I had expected traffic jams and there were none, so I saw the doctor well before the appointed time. Upon registration, I had to fill in two questionnaires about my sleeping habits (especially how they affected me during the day), and both showed that I have some form of sleep problem.

It seemed that the doctor didn't look at the questionnaires at all and neither at my referrals. He did not examine me, and only asked a few standard questions (do I feel sleepy during the day? Yes! Are you healthy? At the moment I have anaemia) before asking the surprising question "Do you want to spend a night here doing the sleep test or would you rather do it at home?".

As I (and apparently everyone else in my position) has remarked on the seeming impossibility of sleeping well in a sleep laboratory, I instantly opted to do the test at home. So I was shown to a technician who showed me the portable machine. Unlike the one which I saw on the Internet (I can't find the same picture again, as I'm writing this on a different machine) which had maybe eleven leads connected to the patient, my portable machine had only the following:
  1. a contact mike just below the throat which records snoring
  2. a position monitor, below the mike, which records in which position the patient is lying
  3. a detector on the third finger which measures oxygen saturation of the blood
  4. a big detector on the index finger which measures pulse, sleep status etc
  5. the brains, a small box, which was taped to the left forearm
I stayed up late (11:20pm) on Thursday, which in retrospect may not have been a good idea. I watched Maccabi basketball luckily eke out an away win, during which I had often felt tired, but not tense regarding the outcome. Once I had connected the machine, I lay in bed waiting to fall asleep. Normally this happens within 20 minutes, but this time I just laid and laid, conscious of the weight on my forearm and the pinching of my index finger, waiting for the kiss of sleep.

I looked at the clock and saw that it was about 01:30am. I imagine that I must have slept an hour but it didn't feel like that. I got up, went to the toilet then came back to bed ... laid there for another fruitless hour ... finally fell asleep until 05:00am. This time I realised that there was no point in trying to fall asleep again, so after about half an hour I removed all the detectors.

I have to return the machine on Sunday morning, upon which the technicians will remove the recording in order to diagnose my problems. There was another questionnaire to be completed after the test, which included such key questions as "how many hours do you think you slept?" and "how well did you sleep compared to normal? (much better, better, the same, worse, much worse). I ticked "much worse" and have a suspicion that I will have to do the test again, maybe this time in the clinic itself (I saw the "bedrooms" there), as I don't think that the amount of sleep which I achieved will be sufficient for diagnosis.

A better idea would have been to have worn the equipment for one night without turning it on so that I would have got used to the weight and feeling, and then operate it on a second night. I will suggest this.

As a result of my poor sleep, Friday was exceedingly difficult, being very tired. I had to do some detailed programming and found myself making small mistakes all the time so forced myself to stop.

And now for something completely different ...

I have written here that I help a clinical psychologist. It turns out that I misunderstood the meaning of the term; she is not a clinical psychologist but rather an occupational therapist, someone who helps people find the correct job, or helps communal settlements weed their applicants, choosing only the people whose profile matches the ones desired by the settlements. I try not to interfere with the application of the results obtained from the various tests in order to keep a certain amount of distance. Obviously I do see people's test results, but they don't mean anything to me; I only look at them in order to make sure that my programs do what they're supposed to do, and to suggest better ways of displaying the results.

Sunday, November 25, 2007

MIDI keyboard fun

I wrote earlier about my new computer, which comes furnished with onboard graphics chip, onboard network card and onboard sound board. The latter posed a problem for me as I wasn't sure where I could plug my MIDI keyboard in. On the old computer, the keyboard had a MIDI to GamePort cable, which plugged into the game port on the computer's sound card. No such socket on the new computer, but plenty of USB sockets.

So I ordered via Amazon a Midilink Midi to USB Cable (I tried to find an Israeli supplier but didn't succeed), which cost just under 16 pounds (not including postage). I waited and waited, but no cable arrived. Finally Amazon sent me a supplier feedback questionnaire to which I replied that I'm sure that the cable is fine, but that it hadn't yet arrived. They passed the letter on to the suppliers who contacted me; it seems that Amazon forgot to tell the suppliers that I live in Israel! The cable had indeed been sent and had returned to the suppliers, so they were aware of the fact that there was a problem with my address but probably didn't have my email address.

So again the cable was dispatched, this time to the correct address, and after a few days it arrived. One end of the cable has a USB plug; this naturally was plugged into the computer. The other end is consists of two cables with MIDI (DIN) plugs, one labelled "MIDI out" and the other "MIDI in". I connected the MIDI out plug to the MIDI out socket on the MIDI keyboard, played a few notes ... and nothing. I tried the MIDI in plug, but still no response.

Somewhat defeated, I wrote to the supplier asking for suggestions and decided to sleep on the matter. After considering the problem, I realised that I had expected Windows XP to detect the keyboard automagically (it had detected something on the USB port, but obviously that wasn't enough). In the old days, MIDI went through something called a MPU-401 port, but I could find no reference to such a beast with XP. After checking several articles on the Internet, I found one which talked about deleting MIDI ports via Regedit; I tried this and found that no MIDI ports had been defined, so obviously I had nothing to delete.

It also became clear that I had to install some kind of driver; the keyboard itself is an old one made by a company which no longer exists (Reveal, IIRC), so there was no chance of finding a driver from them. Fortunately I did find a site with generic MIDI drivers, and after downloading, I installed one at random. Still no communication between keyboard and computer with the MIDI out plug connected. Looking at it logically, the plug belongs to the computer, so from its point of view, data being sent from the keyboard should be MIDI in, whereas the keyboard sees it as MIDI out.

So I switched plugs, and lo and behold, there was communication between the two devices! I quickly checked several music programs (MIDI sequencer, Reason and another program), and yes, all of them could now understand the keyboard.

The only remaining problem is that I don't have a musical idea in my head at the moment, but judging by the past, there soon will be.

Tuesday, November 13, 2007

My body is falling apart

I haven't written anything here lately because I haven't felt well enough. After undergoing several blood tests and examinations, it turns out that I have:
  1. Anaemia
  2. Sleep apnea
  3. Knee bursitis
  4. A cracked root canal
The combination of anaemia and sleep apnea sufficed to make me very tired during the past few weeks, so it's not surprising that I haven't had any spare energy for activities such as blogging.

Fortunately, the gross affects of anaemia disappear after a few days of iron tablets, and a nasal spray has helped me sleep better. So now I'm feeling much better, even though I'm not totally cured.

The cracked root canal made itself known by displaying a growth on my gums. Fortunately I had a dental checkup scheduled shortly after this appeared, so it was immediately examined. My normal dentist wasn't too sure what is was, so she referred me to her colleague who specialises in root canal treatment and its after-affects. He was fairly sure that the growth was the result of one of the canals cracking, and referred me to a periodontist.

I've just returned from the periodontist who performed minor surgery on the gum and extracted the cracked canal. At the moment my cheek is still numb due to the local anaesthetic, but I can feel the numbness dissipating every minute. Unfortunately, as the anaesthetic goes, so the pain comes. I can only drink cold milk and eat yoghurt today (not too severe a restriction), but from tomorrow I can revert to my normal diet. Stitches out next week.

The bursitis manifests itself as pain around the right knee and difficulty in walking. Unfortunately my regular doctor was away when I realised that the pain wasn't going to go away on its own, and his replacement took two weeks not to diagnose it properly. My doctor gave a thorough examination, made the diagnosis and said that if the pain doesn't go away after another week (during which I was taking medication), he would inject steroids directly into the area. Last week he gave me the injection, and whilst the pain is greatly reduced, it is still there and still makes walking awkwards sometimes.

Isn't life grand? The only good thing about all these aches and pains is that none of them are very serious (although the anaemia would be if it weren't treated for a long time).